Skip to main content

Posts

Showing posts from May, 2017

HAPTIC FEEDBACK - ANDROID TUTORIAL

Haptic Feedback ? Haptic feedback, often referred to as simply "haptics", is the use of the sense of touch in a user interface design to provide information to an end user. The resistive force that some "force feedback" joysticks and video game steering wheels provide is another form of haptic feedback. Haptic Feedback in Android??? Haptic feedback (commonly referred to as haptics) is the use of touchfeedback to the end user. You know how your Android phone vibrates a tiny bit when you tap one of the navigation buttons? That's haptics at work. How it works ? By default haptic feedback setter works only for long press.  Here we are implementing this haptic feedback in simple onClick You need to add the "android.permission.VIBRATE" permission to the program's manifest.  You can do so by adding the following to the "AndroidManifest.xml" file, <uses-permission android:name = "android.permission.VIBRATE"...

Create RadioButton RadioGroup Dynamically - Android Tutorial

In this article, we took a look at how to create Radio Buttons Dynamically. Here I have created this example to create the number of time slots (slot select by Radio Button) in between two selected time. The final output looks like, Here I have selected the Start time as 10:00 AM and End time as 12:00 PM and the Time interval between two slots as 15 mins. Therefore the calculation will result as 8 slots. MainActivity Class Example shows the Radio group in Grid view -  Adding the values to an ArrayList, String slotscounts += " "+slotStartTime+ "-"+slotEndTime +","; ArrayList<String> slots = new ArrayList<>(); slots.add(slotscounts); Passing the value to an Adapter class(Base Adapter used) /*Call adapter to set_radiobuttons_for_timeSlots*/ GridSlotAdapter gridslotadapter = new GridSlotAdapter(MainActivity.this, slots); /*set an adapter in Gridview*/ slotGrid.setAdapter(gridslotadapter); Adapter Class Adapter layout ...

RETROFIT HTTP LIBRARY - ANDROID TUTORIAL

Retrofit is same as Volley and it is definitely the better alternative to volley in terms of ease of use, performance, extensibility and other things. It is a type-­safe REST client for Android built by Square. Using this tool android developer can make all network stuff much more easier.  Now let’s see the action of retrofit by creating a new project.  As an example, we are going to download some json and show it in RecyclerView as a list. Step 1. Create a new project in Android Studio Step 2.  Open build.gradle and add Retrofit        compile 'com.squareup.retrofit2:retrofit:2.1.0' make change over dependencies dependencies {     compile fileTree(dir: 'libs', include: ['*.jar'])     testCompile 'junit:junit:4.12'     compile 'com.android.support:appcompat-v7:23.1.1'     compile 'com.android.support:design:23.1.0'     compile 'com.squareup.retrofit2:re...