Add Picture to Android App

When you want to add picture to android app, you need to insert ImageView widget first.

Inserting-ImageView-Widget

Now, prepare your picture in PNG format (recommended size should be inside dimension of 80X80 pixels). Then paste it into app→src→main→res→drawable.
Note: your PNG file must not have no special characters in it’s name, including “-“.
Then go to res→layout→activity_main.xml in text mode and add code similar to this:

<ImageView

android:layout_width=”wrap_content”

android:layout_height=”wrap_content”

android:id=”@+id/imageView”

android:layout_alignParentLeft =”true”

android:layout_alignParentTop=”true”

android:background=”@drawable/voltagedivider”

/>

ImageView-backgroung-code

And that is all for adding picture to android app.

External links:

How to Add Picture to Android App on Mkyong
How to Add Picture to Android App on Higherpass

Posted in android

Leave a Reply

Your email address will not be published. Required fields are marked *

*