[android-developers] Re: UI performance is slow on large screen tablet
ConvertView is used. What else to optimize? Profile the part that is slow is a great answer. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] UI performance is slow on large screen tablet
Hi, Running an app on a number of Samsung tablets having varying screen size, it's clearly noticeable that the tablet having smaller screen is much faster in UI performance compared to those having bigger screen size. Take list view as an example, scrolling speed differs a lot between the smaller and the bigger sibling. Could somebody here point out what are the contributing factors to such issue? and what could be done to optimize the UI speed? Thanks, dara kok -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] interval between invalidate/similar method call
interval between invalidate call what is the refresh interval between each call to invalidate or similar method? according to Android documentation, in one second, android device can draw up to 50 times per second. In my example, if i wan to animate an object on x-coordinate from point A to B by only increment x value from each loop instance, and combine with the theory above, logical my previously drawn object won't be visible by user because of the fast-pace drawing where each previously drawn screen is immediately wipe out and replaced by a new screen. so could someone tell is there a delay whenever there is a request to redraw a screen? and if so, how can android achive 40 or 50 frames per second? darakok -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] AudioTrack class only plays the first half of sound track
Hi, I've got a sample class demoing the use of Android AudioTrack class. It's a very simple one which make use of 2 threads. One to read data from a wav file chunk by chunk and another thread to play it back. My issue is that it only play the first half and then the sound vanishes. Please help Darakok -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=enpackage rmd.media.StreamingAudio; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.security.InvalidParameterException; import java.net.InetAddress; import java.net.DatagramSocket; import java.net.DatagramPacket; import java.net.SocketException; import java.net.UnknownHostException; import android.app.Activity; import android.media.AudioFormat; import android.media.AudioManager; import android.media.AudioTrack; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.util.Log; /** UdpStream activity sends and recv audio data through udp */ public class UdpStream extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.udpstream); Button btnSend = (Button)findViewById(R.id.btnSend); btnSend.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Log.d(LOG_TAG, btnSend clicked); SendAudio(); } }); Button btnRecv = (Button)findViewById(R.id.btnRecv); btnRecv.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Log.d(LOG_TAG, btnRecv clicked); RecvAudio(); } }); } static final String LOG_TAG = UdpStream; static final String AUDIO_FILE_PATH = /data/1.wav; static final int SAMPLE_RATE = 9142; static final int AUDIO_PORT = 2048; static final int SAMPLE_INTERVAL = 20; // milliseconds static final int SAMPLE_SIZE = 2; // bytes per sample static final int BUF_SIZE = SAMPLE_RATE;//AudioTrack.getMinBufferSize(SAMPLE_RATE, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT)*4; public void RecvAudio() { Thread thrd = new Thread(new Runnable() { @Override public void run() { Log.i(Sophat,Buffered size: +BUF_SIZE); Log.e(LOG_TAG, start recv thread, thread id: + Thread.currentThread().getId()); AudioTrack track = new AudioTrack(AudioManager.STREAM_MUSIC, SAMPLE_RATE, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, BUF_SIZE, AudioTrack.MODE_STREAM); track.play(); try { long totalByteReceived=0; DatagramSocket sock = new DatagramSocket(AUDIO_PORT); byte[] buf = new byte[BUF_SIZE]; while(true) { DatagramPacket pack = new DatagramPacket(buf, BUF_SIZE); sock.receive(pack); totalByteReceived+=pack.getLength(); Log.d(LOG_TAG, String.format(recv pack: %d, totalByteReceived: %d, pack.getLength(), totalByteReceived)); track.write(pack.getData(), 0, pack.getLength()); } } catch (SocketException se) { Log.e(LOG_TAG, SocketException: + se.toString()); } catch (IOException ie) { Log.e(LOG_TAG, IOException + ie.toString()); } } // end run }); thrd.start(); } public void SendAudio() { Thread thrd = new Thread(new Runnable() { @Override public void run() { Log.e(LOG_TAG, start send thread, thread id: + Thread.currentThread().getId()); long file_size = 0; int bytes_read = 0; int bytes_count = 0; File audio = new File(AUDIO_FILE_PATH);
[android-developers] Re: AudioTrack class only plays the first half of sound track
additional observation: a system call to GG_EXPLICIT is made before the audio stop playing. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] All fragments are reloaded when return from an activity
Hi, I have an activity with a couple of fragments. Only one fragment is displayed at a time and I switch from one fragment to another using the FragmentTransaction.replace method. It works alright. A strange behavior happens when i allow user to leave the fragment and launch another activity. Immediately when user presses the back key, the previous activity will relaunch all the fragments inside of it. Could someone help explains this behavior? Thanks, darakok -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] widget stop working after force close in setting page
Totally agree with what you said technically. But from a user point of view, it is weird to have a widget on screen that is not usable after a force stop. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] widget stop working after force close in setting page
Kristopher Micinski, u're right. Never thought it is this hard to explain someone what I mean. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] widget stop working after force close in setting page
force stop is supposed to reset the app. But it does not seem right that the widget stops working. logically The force stop button should act as a single point to reset both the app and widget that belong to the app -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] widget stop working after force close in setting page
A button, I refer to the option to force close an app under application section in android system setting page. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] widget stop working after force close in setting page
A Simple app with a widget that once a button on the widget is clicked, it will lead back into the app. My issue is that when the app is force close using a button in the application setting page, my widget becomes actionless. I've put a few log statement within the widget provider. after the force close event, the log statement wont produce any text so it means to me that the widgetprovider knows nothing about touch event after the force close action is clicked. Anyone here knows how to reactivate my widget? Thanks, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Webview.loadDataWithBaseURL can't load html with image
Hi, I've been searching through SO and there plenty of resource showing how to display html string with image inside of it. But I still can't make it work in my case. Below is my only line of code. It actually links to a valid image resource. vw.loadDataWithBaseURL(http://cf.scdn.co;, Image: img src='http://cf.scdn.co/i/wp/mobile/mobile_platform_android.jpg' /, text/html, utf-8, about:blank); In the web view, it only shows Image: ? with a question mark box. Any idea? Thanks, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Webview.loadDataWithBaseURL can't load html with image
yes, that's what's missing. Thanks a lot. Always overlook this manifest thing. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Using ActionBar while remains compatible with Android 2.x?
Why not just ur solution here. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Gridview whose cell have differing size
Hello, Can you tell if it's possible to build gridview widget to have a number of cells with some cells span multiple columns forward and a few rows downward? Thanks, darakok -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Listview based on CursorAdapter, how to skip displaying a row?
Hello, I try to create list view that get its data from CursorAdapter. My cursor will contain all the row. And within the adapter implementation, base on a criteria, I want to skip a certain row from being displaying in the listview. Is that possible? Example from a newView or bindView method, i return null. will that work? Thanks, darakok -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Listview based on CursorAdapter, how to skip displaying a row?
Thanks for ur comment. I need to have everything in the cursor, can't filter it out. Because even though I will skip a certain row, but i still need data form that row for backend processing within the adapter. That's why I need a solution to skip a row within the adapter. Thanks, darakok -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Listview based on CursorAdapter, how to skip displaying a row?
Within one list item, I want to display 2 or 3 rows of data from the cursor, it's displayed as multiple column in a single list view row. So with that requirement, I can use a gridView. But my trouble is for a certain row from the cursor, it may fill the space of 2 columns. In overall, the drawing space of a row from the cursor will vary. So I have to use a list view, and will need to skip a row if it's already displayed along other row in a list view item. darakok -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Android ADT 14, build with maven fail. Cannot create the APKBuilder object, NullPointerException
Hello, After upgrading to the latest ADT v14, I've an issue when I build my project using maven. I've updated both the ADT and SDK tools to the latest version. Creating additional unsigned apk file /user/user-aaa/xxx-SNAPSHOT-unsigned.apk [ERROR] Cannot create the APKBuilder object java.lang.NullPointerException at com.jayway.maven.plugins.android.phase09package.ApkBuilder.init(ApkBuilder.java:195) at com.jayway.maven.plugins.android.phase09package.ApkMojo.doAPKWithAPKBuilder(ApkMojo.java:206) at com.jayway.maven.plugins.android.phase09package.ApkMojo.createApkFile(ApkMojo.java:171) at com.jayway.maven.plugins.android.phase09package.ApkMojo.execute(ApkMojo.java:141) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) What's wrong? darakok -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Why dither a bitmap
Can somebody here explain me why dithering is needed in Android? Thanks dara kok -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Image dpi, does Android care about it?
It's said that dpi is only relevant when printing a document, not when viewing the image on screen. in my case, i have an image created with regular resolution, 70 dpi. when i put and display it on a phone with size set to wrap content. it shows a bit stretched out and the edge is blurry. but when i increase resolution of the same image, say 300 dpi, and display it in my app again, it shows a smaller image with crisp edge. so it seems image resolution has an effect here. but i just can't understand how Android interpret the change in resolution. Can anyone here help me understand this? Thanks, dara kok -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] width of image 480px doesn't fit device screen (webview)
Hi, I've a problem trying to understand one thing. I use an image measured to be 480px wide according to its property screen shown on my computer. and I have a HTC Incredible S. Looking at the device spec, it shows 480px wide screen. I build an app and use the image, load the image from local asset folder into a webview control. It surprises me when the webview control shows the image almost 2 times as big as the width of the device screen. the image should exactly fill the screen as the webview control fills the whole width of the device screen. What i did was just creating a simple html file with an img tag inside without specifying anything other than its source property. So anyone here knows what wrong. Thanks dara kok -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] maven-android-plugin, ActionBar - Symbol not found
Hello, I use maven to build android project. it was running alright until one of my class make reference to ActionBar class. In the pom file, I change the maven android plugin build version to 11. The problem is maven doesn't recognize the ActionBar class. It shows Symbol not found. error message. Any idea of this error. Dara kok -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Open sms app from a link in webview
I receive the following error when click on a link in a webview control which open an sms app on my HTC legend 2.1. My html is like this: a href='sms:##'##/a On emulator, it runs fine. - java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.mms/com.android.mms.ui.ComposeMessageActivity}: java.lang.IndexOutOfBoundsException 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596) 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621) 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at android.app.ActivityThread.access$2200(ActivityThread.java:126) 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932) 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at android.os.Handler.dispatchMessage(Handler.java:99) 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at android.os.Looper.loop(Looper.java:123) 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at android.app.ActivityThread.main(ActivityThread.java:4595) 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at java.lang.reflect.Method.invokeNative(Native Method) 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at java.lang.reflect.Method.invoke(Method.java:521) 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at dalvik.system.NativeStart.main(Native Method) 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): Caused by: java.lang.IndexOutOfBoundsException 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at android.net.Uri$PathSegments.get(Uri.java:934) 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at android.net.Uri$PathSegments.get(Uri.java:919) 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at com.android.mms.ui.ComposeMessageActivity.handleIntentViewAction(ComposeMessageActivity.java:3603) 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at com.android.mms.ui.ComposeMessageActivity.onCreate(ComposeMessageActivity.java:3717) 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 09-05 17:16:51.223: ERROR/AndroidRuntime(2974): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Open OpenOffice with Read only access to Data
Dont think this is possible. Unless your flag is supported by the target application. dara kok -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en