Skip to main content

Posts

Showing posts with the label Mobile

ListView Using CustomAdapter with setter getter method

For this we need following three classes Main Class where we would be implementing listview using custom Adapter(CustomAdapterExample.java) Second Class for designing our Custom Adapter(CustomAdapter.java) And the last one for getter setter method for data transfer(User.java) Along with these three java classes we need two xml file one would be default xml file (activity_custom_adapter_example.xml) for main class and another one for making Listview layout (simple_list_items.xml)  In activity_custom_adapter_example.xml, take a ListView element from the Widgets and in simple_list_items.xml, take two textviews.

ListView Example in Android

To create a simple listview in android as shown in below image, we generally need three things. 1. ListView 2. ArrayAdapter 3. Simple String array. Image 1 activity_main.xml

DropDown List in Android using Spinner

Usually we use drop down list in forms. In android we could achieve this using Spinner. Here goes the Code: activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/LinearLayout1"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical"     android:paddingBottom="@dimen/activity_vertical_margin"     android:paddingLeft="@dimen/activity_horizontal_margin"     android:paddingRight="@dimen/activity_horizontal_margin"     android:paddingTop="@dimen/activity_vertical_margin"     tools:context=".MainActivity" >

SET ENVIRONMENT VARIABLES FOR JAVA INSTALLATION

Goto MyComputer ->> Properties ->> Advanced System Settings->> Enviornment Variables After that In user variable Make a folder Named JAVA_HOME  and set its value: C:\Program Files\Java\jdk1.7.0_45\lib and click ok if that doesn't work try this: In user Variable, click on new at bottom of tab give JAVA_HOME in variable name in value : \ProgramFiles\java\jdkk1.8.0_05