Hy…hy… I come back and i want to pos…

Hy…hy… I come back and i want to post about show image on website. Ok lets to try now.

public Bitmap DownloadImage(String url){
Bitmap gambar=null;
InputStream is=null;

try{
is=OpenHttpConnection(url);
gambar=BitmapFactory.decodeStream(is);
is.close();
}
catch(IOException e){
e.printsacktrace();
}
return gambar;
}



//this is a main activity code
public class MaintActivity extends Activity{
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setcontentview(R.layout.main);

Bitmap gambar=DownloadImage("http://a0.twimg.com/profile_images/1175637596/ccc20bf13ff2ab83323039de0411248d_avatar_normal.jpg");
fotoaq=(Image)findViewById(R.id.fotoq);
fotoaq.setImageBitmap(gambar);
}
}


//add in your main.xml

<ImageView
android:id="@+id/fotoaq"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>

refference : http://www.devx.com/wireless/Article/39810/1954

happy cooding brader😀

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s