Few moment with Android


1. Android Core Building Blocks                                                 An android component is simply a piece of code that has a well defined life cycle e.g. Activity, Receiver, Service etc. (i) Activity : An activity... Continue Reading →

Advertisements

Android : Page Swiping using ViewPager


 As a follow up on my last Fragments post, I thought it would be useful to include another Honeycomb feature which is the View Pager that implements for page swiping UI pattern.In this example, I’ve re-used the Fragment implements from the Tabs post.RequirementsTo implement a Tabbed, using fragments on devices running Android 2.1 or higher,... Continue Reading →

Capture image from camera in Android Application


1. Add in Manifest.xml uses-feature android:name="android.hardware.camera" android:required="true" 2.Take Picture From Camera static final int REQUEST_IMAGE_CAPTURE = 1; private void dispatchTakePictureIntent() {     Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);     if (takePictureIntent.resolveActivity(getPackageManager()) != null) {         startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);     } } 3. Save or display it ob ImageView. @Override protected void... Continue Reading →

List View in Android


Step 1. create a xml file name as “friend_detail.xml” in layout . Step 2. Add a list View . Step 3 . Create a class file in src name as FriendDetail.java . Step4 . Write following Code in OnCreate method. final ListView listview = (ListView) findViewById(R.id.listView1); String[] values = new String[] { "Android", "iPhone", "WindowsMobile",... Continue Reading →

Move in other Window on Clicking Button In Android


Button login=(Button) findViewById(R.id.checkinView); /*...........................Go to Check in View......................*/ login.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent move = new Intent(mainView.this, CheckInView.class); move.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(move); } });

Grid View with Image and Label in Android


Step1.    Create a XML in Layout of type Linear Layout. Step2. Paste  Following  Code for Image view and Label . <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="5dp" android:orientation="vertical" > <ImageView android:id="@+id/grid_item_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="10px" android:src="@drawable/demo" > </ImageView> <TextView android:id="@+id/grid_item_label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@+id/label" android:layout_marginLeft="2dp" android:layout_marginTop="5dp" android:textSize="10dp" > </TextView> </LinearLayout> you can also create own... Continue Reading →

Blog at WordPress.com.

Up ↑

%d bloggers like this: