Android backgroud image slow the app

0 votes

For the left slide menu, I'm using DrawerLayout. When I use an image as the background, my app becomes sluggish. However, it is smooth when I use color as the background.

my code is

<android.support.v4.widget.DrawerLayout    
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:background="@drawable/app_bg"
android:layout_height="match_parent" >

<FrameLayout
    android:id="@+id/content_frame"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

<ListView
    android:id="@+id/left_drawer"
    android:layout_width="240dp"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:background="@android:color/white"
    android:choiceMode="singleChoice"
    android:divider="@android:color/transparent"
    android:dividerHeight="0dp" />

</android.support.v4.widget.DrawerLayout>

This background image is from the app @drawable/bg. I have no idea how to get around this and perform a nice sliding action.

My background image .

enter image description here

Nov 10, 2022 in Android by Edureka
• 13,620 points
1,575 views

1 answer to this question.

0 votes
You're mainly noticing the latency because you need to copy your background image to each of the drawable folders (drawable-hdpi, drawable-xhdpi, etc.). I automate using the Android Drawable Importer plugin for Android Studio. Works perfectly.
answered Nov 10, 2022 by Edureka
• 12,690 points

Related Questions In Android

0 votes
0 answers

Android: why the ICICI iMobile Pay App shows the "rooted/jailbroken" device with my app?

The ICICI iMobile Pay app displays the ...READ MORE

Nov 9, 2022 in Android by Edureka
• 12,690 points
1,094 views
0 votes
0 answers

How to implement the system lock screen in your own android app?

How should the system lock screen be ...READ MORE

Nov 22, 2022 in Android by Edureka
• 12,690 points
714 views
0 votes
0 answers
0 votes
0 answers
0 votes
1 answer

Android backgroud image slow the app

You should have diferentiate sizes for deferent ...READ MORE

answered Jun 16, 2022 in Others by polo
• 1,480 points
597 views
0 votes
1 answer

How to get Bitmap from an Uri?

Try using the following lines of code ...READ MORE

answered Feb 18, 2022 in Others by Aditya
• 7,680 points
12,180 views
0 votes
0 answers

How to put a border around an Android TextView?

Is it possible to draw a border ...READ MORE

Nov 23, 2022 in Android by Ashwini
• 5,430 points
843 views
0 votes
1 answer

Running docker on Android

According to the documentation, the Android kernel is ...READ MORE

answered Aug 1, 2018 in Docker by Kalgi
• 52,350 points
3,820 views
0 votes
1 answer

How to open the Google Play Store directly from my Android application?

If you want to link to your ...READ MORE

answered Nov 7, 2022 in Android by Edureka
• 12,690 points
4,422 views
0 votes
1 answer

Android in-app billing - How to handle refunds ?

Simply disregard the library's purchase to overcome ...READ MORE

answered Nov 10, 2022 in Android by Edureka
• 12,690 points
1,585 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP