Posts

Creating New Android Project in Eclipse

Image
To create a new project in Eclipse File -> New -> Android Application Project If the Menu item is not shown, then select following File -> New -> Other. It will open a new dialog like this. Here you have to expand the ' Android ' in the dialog box and choose the Android Application Project. then click on Next.   It will take you to the below screen. In this dialog box, 1) You have to enter the name that you are going to give to your application 2) Name of the Project 3) Name of the Package for your app. After giving all the details click on ' Next ' button In this window,  you need to configure the application 1) To choose the laucher icon whether you want use the custom launcher icon(i.e shown in apps screen). 2) Choose the 'Create Activity' to generate a Main Activity by default for project. 3) You select the Mark it as a Library..  If you are going to deve

Creating a HorizontalScrollView of Images like Galery from Drawable

First, we have to create layout for display images in the horizontal view  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical">     <HorizontalScrollView         android:layout_width="match_parent"         android:layout_height="wrap_content" >         <LinearLayout             android:id="@+id/mygallery"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:orientation="horizontal"             />     </HorizontalScrollView> </LinearLayout> I have created a Horizontal Scroll view inside the Linear layout.Save the code in activity_main.xml file. Creating a activity file( MainActi

Creating a Gallery image in android

public class PicSelectActivity extends Activity {         private final int PICKER = 1;     private int currentPic = 0;     //private PicAdapter imgAdapt;     private Gallery picGallery;     private ImageView picView;      Bitmap[] bitmaps;         @Override     public void onCreate(Bundle savedInstanceState) {                  Log.v("******************","process1");         super.onCreate(savedInstanceState);         setContentView(R.layout.imagedat);                               NotesDbAdapter objndb = new NotesDbAdapter(this);         objndb.open();                           Cursor productCursor = null;          productCursor = objndb.mDb.query(NotesDbAdapter.PRODUCT_TABLE,new String[] { "product_img", "product_id" }, null, null, null,null, null, null);          int i=0;                          Gallery galleryView=(Gallery)findViewById(R.id.gallery);          bitmaps = new Bitmap[productCursor.getCount];