Posts

Showing posts from January, 2013

Implement A Image Listener In Android

In the ANDROID development you use this code. It's helpful for you. If you use any image like button then by java coding you use that implement. It is call a image listener. Firstly you have a project in android application who called package com.example.imagebutton (example) then you export these things like Bundle, Activity, Menu, Motion event (Because on touch you call the listener) , View (for image) , On touch listener and etc. Then u use that Java code and enjoy you first app using image listener. package com.example.imagebutton; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; public class Imagebutton extends Activity { ImageView ivCard; TextView editText; boolean isPressed=false; @Override protected void onC...

How to Call a Image as a Button in Android

In this project how i call a image as a button . Then i use the  button and in this button i call the touch listener who call the image on the screen then you already use that code it is tested. You believe that. package com.example.imagebutton; import android.view.View; import android.view.View.OnTouchListener; import android.widget.ImageButton; import android.widget.ImageView; public class Imagebutton extends Activity { ImageView ivCard; boolean isPressed=false; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_imagebutton); addListenerOnImage(); } public void addListenerOnImage()  { // TODO Auto-generated method stub ivCard=(ImageView)findViewById(R.id.imageView1); ivCard.setOnTouchListener(new OnTouchListener()             { @Override public boolean onTouch(View v, MotionEvent event...

How to Draw a Image on Android

Hello friends Its very use full code for you when you are starting learner in android tutorial. Because you  never start without How to draw a image on android. First you create a project Camera testing in Eclipse Go to file section and click on  New Android Project And fill the section. Then work on activity.xml. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:orientation="vertical" >    <ImageView         android:id="@+id/imageView1"         android:layout_width="wrap_content"         android:layout_height="wrap_content"          /> <ImageView         android:id="@+id/imageView2"         android:layout_width="wr...