I developed an application that will broadcast video from the Internet. I have an activity that lists videos, including their thumbnails, titles and status (recently updated). For each line there is a thumbnail for the video, the title of the video, and then a βfreshβ icon to indicate a new download.
In the emulator, this works relatively well. It works great on 2.3 and 4.0.3 HTC Evo devices. On HTC One 4.3, this activity is very slow. Clicking on a list item that leads you to another action works fine. Other actions are in order, except for activity on the list.
Here is what I have experimented so far. I removed the "fresh" icon from xml and it worked great. Therefore, I suggested that this has something to do with this icon. The image is quite large (1000x900px), but only displayed at 50x50dp. I did not try to reduce this image to see performance. But if this is a problem, why old HTC phones can display it perfectly.
The only difference from HTC One and older HTC phones is that HTC One has an action bar, while older phones use a dedicated menu key on the device.
Is there a way to check the memory usage or processes during the launch of the application on the device to understand why it is so slow?
UPDATE: I resized the image to 100x100px and it is definitely faster. But I still notice that there is some lag.
Here's the layout for this line of the list:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="2dp" android:paddingTop="2dp" > <ImageView android:id="@+id/icon" android:layout_width="100dp" android:layout_height="100dp" android:layout_alignParentLeft="true" android:layout_centerVertical="true" /> <ImageView android:id="@+id/status" android:layout_width="50dp" android:layout_height="50dp" android:layout_alignParentRight="true" android:layout_alignParentTop="true" /> <TextView android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_marginLeft="10dp" android:layout_toLeftOf="@id/status" android:layout_toRightOf="@id/icon" /> </RelativeLayout>
performance android list imageview
John ng
source share