[android-developers] Android : Why NUMBER_KEY return the number in reverse order
0 down vote favorite Hi, I am trying to read the contact list using the following code: ContentResolver cr = getContentResolver(); Cursor cur = cr.query(People.CONTENT_URI,null, null, null, null); if (cur.getCount() 0) { while (cur.moveToNext()) { String id = cur.getString(cur.getColumnIndex(People._ID)); Cursor personCur = cr.query(Contacts.Phones.CONTENT_URI, null, Contacts.Phones.PERSON_ID += ?+ Contacts.Phones.NUMBER_KEY , new String[]{id}, null); String phoneKey = ; while (personCur.moveToNext()) { phoneKey = personCur.getString(personCur.getColumnIndex(Contacts.Phones.NUMBER_KEY)); } The problem is that phoneKey return in reverse order meaning if the phone number is 054-123-4567 the value is 7654321450 I could not find any documentation on this issue. Any idea how to fix it? or is it the expected result? thanks -Z -- 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: Android : Why NUMBER_KEY return the number in reverse order
First, thanks for your quick answer. Second, I am using SDK 1.5 therefore I am using Contacts.Phones.NUMBER_KEY. Third, Contacts.Phones.NUMBER is not normalize and include chars like ( and - and I want to compare between number I hold and number in the contact list -Z On Jan 3, 10:45 am, Sarwar Erfan erfanonl...@gmail.com wrote: Firstly, Contacts.Phones.NUMBER_KEY is deprecated. Secondly, why do you need this value? This is not the phone number, but the normalized phone number. If you want the phone number in the way you have your code, use Contacts.Phones.NUMBER Anyways, I would suggest you not to use deprecated elements unless you are targeting older phones. Regards Sarwar Erfan -- 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: Android : Why NUMBER_KEY return the number in reverse order
thanks On Jan 3, 11:27 am, Sarwar Erfan erfanonl...@gmail.com wrote: Ok... here is the story then... Phone numbers are stored in stripped reversed order for easier matching. It helps to use the LIKE operator in SQL. For a normal SQL user, it might look same to use *where NUMBER_KEY LIKE '%1234'* and *where NUMBER_KEY LIKE '4321%'.* But for the db engine, having the wildcard at the end is much easier (efficient) Efficiency is a major factor for incoming call caller id lookup. BTW, you might have not noticed, most phones (not talking about android only) does not match the whole number for caller id lookup. In all my Nokia phones I have a number saved, say its 016 12345678 (its not the real number) as Mr X When I get phone call from another number 016 99345678, it shows Mr X is calling. It compares only last few digits!!! Regards Sarwar Erfan -- 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: issues after updating SDK manager
I lately updated my Android SDK manager and since then my android went koo koo. I manage to fix most of the problems but 2 of them are still exists: 1. when I run the SDK Manager.exe I get Some packages were found but are not compatible updates message under Available Packages- android repository 2. under Available Packages- third party add-ons I see some existing updates but when I update them they are still there. Did anyone bumped with this issue? how can I fix it? thanks -Z -- 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] Video is not shown when returning to app
Hi, I have an activity with MediaPlayer and Button. The MediaPlayer contains a VideoView (using MediaPlayer.getDisplay(VideoView.getHolder())). When the button is pressed it pause the MediaPlayer and open a browser. returning to app suppose to continue the video (MediaPlayer .start()) When the activity started the video is plays and shown as expected but when i press the button and then I press return to the app the video is not shown but the sound is working. Any idea how to make the video visible? -Z -- 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] How to extend intent
Hi, I am using the following code to play video: Intent myIntent = new Intent(Intent.ACTION_VIEW); Uri u = Uri.parse(path); myIntent.setDataAndType(u, video/*); try { context.startActivity(myIntent); } catch (ActivityNotFoundException e) { Log.e(TAG, cannot initiate video, e); } Is it possible to extend the intent and add it some abilities such as : notify when video complete to play? get user events (stop play etc),add new button? If yes how? I failed to find any example for it Zohar -- 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: How to extend intent
thanks On Oct 6, 11:55 am, Kumar Bibek coomar@gmail.com wrote: No, you cannot do that unless you know if the target component supports these callbacks (sets Result ) on finish. On Wed, Oct 6, 2010 at 3:21 PM, zohar lerman lirazo...@gmail.com wrote: Hi, I am using the following code to play video: Intent myIntent = new Intent(Intent.ACTION_VIEW); Uri u = Uri.parse(path); myIntent.setDataAndType(u, video/*); try { context.startActivity(myIntent); } catch (ActivityNotFoundException e) { Log.e(TAG, cannot initiate video, e); } Is it possible to extend the intent and add it some abilities such as : notify when video complete to play? get user events (stop play etc),add new button? If yes how? I failed to find any example for it Zohar -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com -- 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] mediaController in APIDemo
Hi I am using the code of APIDemo for streaming video. I want to add control bar to the videoview. I added the following code to the MediaPlayerDemo_Video.oncreate but the control was not shown: mPreview = (VideoView) findViewById(R.id.surface); MediaController mediaController = new MediaController(mPreview.getContext()); mediaController.setAnchorView(mPreview); mediaController.setMediaPlayer(mPreview); mPreview.setMediaController(mediaController); any idea why? thanks Zohar -- 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: problem to run video stream in 1.5
any one? On Oct 4, 10:47 am, zohar lerman lirazo...@gmail.com wrote: Hi I am trying to play the streaming video using the API demo application. I set the path to mp4 link from the web. when i run it with Nexsus 1 (SDK 2.2.1) it is working as expected but on HTC Dream (SDK 1.5) it throws the following exception: 10-04 10:46:42.073: ERROR/ZL(3984): error: Prepare failed.: status=0x1 10-04 10:46:42.073: ERROR/ZL(3984): java.io.IOException: Prepare failed.: status=0x1 10-04 10:46:42.073: ERROR/ZL(3984): at android.media.MediaPlayer.prepare(Native Method) 10-04 10:46:42.073: ERROR/ZL(3984): at com.example.android.apis.media.MediaPlayerDemo_Video.playVideo(MediaPlayerDemo_Video.java: 109) 10-04 10:46:42.073: ERROR/ZL(3984): at com.example.android.apis.media.MediaPlayerDemo_Video.surfaceCreated(MediaPlayerDemo_Video.java: 154) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.SurfaceView.updateWindow(SurfaceView.java:352) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.SurfaceView.dispatchDraw(SurfaceView.java:259) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.drawChild(ViewGroup.java:1534) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1278) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.drawChild(ViewGroup.java:1534) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1278) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.View.draw(View.java:5841) 10-04 10:46:42.073: ERROR/ZL(3984): at android.widget.FrameLayout.draw(FrameLayout.java:352) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.drawChild(ViewGroup.java:1536) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1278) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.drawChild(ViewGroup.java:1534) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1278) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.View.draw(View.java:5841) 10-04 10:46:42.073: ERROR/ZL(3984): at android.widget.FrameLayout.draw(FrameLayout.java:352) 10-04 10:46:42.073: ERROR/ZL(3984): at com.android.internal.policy.impl.PhoneWindow $DecorView.draw(PhoneWindow.java:1898) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewRoot.draw(ViewRoot.java:1217) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewRoot.performTraversals(ViewRoot.java:1030) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewRoot.handleMessage(ViewRoot.java:1482) 10-04 10:46:42.073: ERROR/ZL(3984): at android.os.Handler.dispatchMessage(Handler.java:99) 10-04 10:46:42.073: ERROR/ZL(3984): at android.os.Looper.loop(Looper.java:123) 10-04 10:46:42.073: ERROR/ZL(3984): at android.app.ActivityThread.main(ActivityThread.java:3948) 10-04 10:46:42.073: ERROR/ZL(3984): at java.lang.reflect.Method.invokeNative(Native Method) 10-04 10:46:42.073: ERROR/ZL(3984): at java.lang.reflect.Method.invoke(Method.java:521) 10-04 10:46:42.073: ERROR/ZL(3984): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:782) 10-04 10:46:42.073: ERROR/ZL(3984): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 10-04 10:46:42.073: ERROR/ZL(3984): at dalvik.system.NativeStart.main(Native Method) any idea? -- 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: problem to run video stream in 1.5
any one? On Oct 4, 10:47 am, zohar lerman lirazo...@gmail.com wrote: Hi I am trying to play the streaming video using the API demo application. I set the path to mp4 link from the web. when i run it with Nexsus 1 (SDK 2.2.1) it is working as expected but on HTC Dream (SDK 1.5) it throws the following exception: 10-04 10:46:42.073: ERROR/ZL(3984): error: Prepare failed.: status=0x1 10-04 10:46:42.073: ERROR/ZL(3984): java.io.IOException: Prepare failed.: status=0x1 10-04 10:46:42.073: ERROR/ZL(3984): at android.media.MediaPlayer.prepare(Native Method) 10-04 10:46:42.073: ERROR/ZL(3984): at com.example.android.apis.media.MediaPlayerDemo_Video.playVideo(MediaPlayerDemo_Video.java: 109) 10-04 10:46:42.073: ERROR/ZL(3984): at com.example.android.apis.media.MediaPlayerDemo_Video.surfaceCreated(MediaPlayerDemo_Video.java: 154) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.SurfaceView.updateWindow(SurfaceView.java:352) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.SurfaceView.dispatchDraw(SurfaceView.java:259) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.drawChild(ViewGroup.java:1534) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1278) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.drawChild(ViewGroup.java:1534) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1278) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.View.draw(View.java:5841) 10-04 10:46:42.073: ERROR/ZL(3984): at android.widget.FrameLayout.draw(FrameLayout.java:352) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.drawChild(ViewGroup.java:1536) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1278) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.drawChild(ViewGroup.java:1534) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1278) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.View.draw(View.java:5841) 10-04 10:46:42.073: ERROR/ZL(3984): at android.widget.FrameLayout.draw(FrameLayout.java:352) 10-04 10:46:42.073: ERROR/ZL(3984): at com.android.internal.policy.impl.PhoneWindow $DecorView.draw(PhoneWindow.java:1898) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewRoot.draw(ViewRoot.java:1217) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewRoot.performTraversals(ViewRoot.java:1030) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewRoot.handleMessage(ViewRoot.java:1482) 10-04 10:46:42.073: ERROR/ZL(3984): at android.os.Handler.dispatchMessage(Handler.java:99) 10-04 10:46:42.073: ERROR/ZL(3984): at android.os.Looper.loop(Looper.java:123) 10-04 10:46:42.073: ERROR/ZL(3984): at android.app.ActivityThread.main(ActivityThread.java:3948) 10-04 10:46:42.073: ERROR/ZL(3984): at java.lang.reflect.Method.invokeNative(Native Method) 10-04 10:46:42.073: ERROR/ZL(3984): at java.lang.reflect.Method.invoke(Method.java:521) 10-04 10:46:42.073: ERROR/ZL(3984): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:782) 10-04 10:46:42.073: ERROR/ZL(3984): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 10-04 10:46:42.073: ERROR/ZL(3984): at dalvik.system.NativeStart.main(Native Method) any idea? -- 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: problem to run video stream in 1.5
any one? On Oct 4, 10:47 am, zohar lerman lirazo...@gmail.com wrote: Hi I am trying to play the streaming video using the API demo application. I set the path to mp4 link from the web. when i run it with Nexsus 1 (SDK 2.2.1) it is working as expected but on HTC Dream (SDK 1.5) it throws the following exception: 10-04 10:46:42.073: ERROR/ZL(3984): error: Prepare failed.: status=0x1 10-04 10:46:42.073: ERROR/ZL(3984): java.io.IOException: Prepare failed.: status=0x1 10-04 10:46:42.073: ERROR/ZL(3984): at android.media.MediaPlayer.prepare(Native Method) 10-04 10:46:42.073: ERROR/ZL(3984): at com.example.android.apis.media.MediaPlayerDemo_Video.playVideo(MediaPlayerDemo_Video.java: 109) 10-04 10:46:42.073: ERROR/ZL(3984): at com.example.android.apis.media.MediaPlayerDemo_Video.surfaceCreated(MediaPlayerDemo_Video.java: 154) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.SurfaceView.updateWindow(SurfaceView.java:352) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.SurfaceView.dispatchDraw(SurfaceView.java:259) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.drawChild(ViewGroup.java:1534) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1278) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.drawChild(ViewGroup.java:1534) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1278) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.View.draw(View.java:5841) 10-04 10:46:42.073: ERROR/ZL(3984): at android.widget.FrameLayout.draw(FrameLayout.java:352) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.drawChild(ViewGroup.java:1536) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1278) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.drawChild(ViewGroup.java:1534) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1278) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.View.draw(View.java:5841) 10-04 10:46:42.073: ERROR/ZL(3984): at android.widget.FrameLayout.draw(FrameLayout.java:352) 10-04 10:46:42.073: ERROR/ZL(3984): at com.android.internal.policy.impl.PhoneWindow $DecorView.draw(PhoneWindow.java:1898) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewRoot.draw(ViewRoot.java:1217) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewRoot.performTraversals(ViewRoot.java:1030) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewRoot.handleMessage(ViewRoot.java:1482) 10-04 10:46:42.073: ERROR/ZL(3984): at android.os.Handler.dispatchMessage(Handler.java:99) 10-04 10:46:42.073: ERROR/ZL(3984): at android.os.Looper.loop(Looper.java:123) 10-04 10:46:42.073: ERROR/ZL(3984): at android.app.ActivityThread.main(ActivityThread.java:3948) 10-04 10:46:42.073: ERROR/ZL(3984): at java.lang.reflect.Method.invokeNative(Native Method) 10-04 10:46:42.073: ERROR/ZL(3984): at java.lang.reflect.Method.invoke(Method.java:521) 10-04 10:46:42.073: ERROR/ZL(3984): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:782) 10-04 10:46:42.073: ERROR/ZL(3984): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 10-04 10:46:42.073: ERROR/ZL(3984): at dalvik.system.NativeStart.main(Native Method) any idea? -- 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] problem to run video stream in 1.5
Hi I am trying to play the streaming video using the API demo application. I set the path to mp4 link from the web. when i run it with Nexsus 1 (SDK 2.2.1) it is working as expected but on HTC Dream (SDK 1.5) it throws the following exception: 10-04 10:46:42.073: ERROR/ZL(3984): error: Prepare failed.: status=0x1 10-04 10:46:42.073: ERROR/ZL(3984): java.io.IOException: Prepare failed.: status=0x1 10-04 10:46:42.073: ERROR/ZL(3984): at android.media.MediaPlayer.prepare(Native Method) 10-04 10:46:42.073: ERROR/ZL(3984): at com.example.android.apis.media.MediaPlayerDemo_Video.playVideo(MediaPlayerDemo_Video.java: 109) 10-04 10:46:42.073: ERROR/ZL(3984): at com.example.android.apis.media.MediaPlayerDemo_Video.surfaceCreated(MediaPlayerDemo_Video.java: 154) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.SurfaceView.updateWindow(SurfaceView.java:352) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.SurfaceView.dispatchDraw(SurfaceView.java:259) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.drawChild(ViewGroup.java:1534) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1278) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.drawChild(ViewGroup.java:1534) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1278) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.View.draw(View.java:5841) 10-04 10:46:42.073: ERROR/ZL(3984): at android.widget.FrameLayout.draw(FrameLayout.java:352) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.drawChild(ViewGroup.java:1536) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1278) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.drawChild(ViewGroup.java:1534) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1278) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.View.draw(View.java:5841) 10-04 10:46:42.073: ERROR/ZL(3984): at android.widget.FrameLayout.draw(FrameLayout.java:352) 10-04 10:46:42.073: ERROR/ZL(3984): at com.android.internal.policy.impl.PhoneWindow $DecorView.draw(PhoneWindow.java:1898) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewRoot.draw(ViewRoot.java:1217) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewRoot.performTraversals(ViewRoot.java:1030) 10-04 10:46:42.073: ERROR/ZL(3984): at android.view.ViewRoot.handleMessage(ViewRoot.java:1482) 10-04 10:46:42.073: ERROR/ZL(3984): at android.os.Handler.dispatchMessage(Handler.java:99) 10-04 10:46:42.073: ERROR/ZL(3984): at android.os.Looper.loop(Looper.java:123) 10-04 10:46:42.073: ERROR/ZL(3984): at android.app.ActivityThread.main(ActivityThread.java:3948) 10-04 10:46:42.073: ERROR/ZL(3984): at java.lang.reflect.Method.invokeNative(Native Method) 10-04 10:46:42.073: ERROR/ZL(3984): at java.lang.reflect.Method.invoke(Method.java:521) 10-04 10:46:42.073: ERROR/ZL(3984): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:782) 10-04 10:46:42.073: ERROR/ZL(3984): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 10-04 10:46:42.073: ERROR/ZL(3984): at dalvik.system.NativeStart.main(Native Method) any idea? -- 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] How to stream video
Hi, I want to play video file that exists in one of my servers. I am using MediaPlay and VideoView classes and it works fine but the problem is that the video start to play only when it finished downloading the whole file. How can i stream it, meaning play the video while it continues to download? thanks -Z -- 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] Browser Source code
Hi, Where can i find the Android Browser source code? Thanks Zohar -- 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: Browser Source code
thanks On Aug 29, 2:27 pm, Mark Murphy mmur...@commonsware.com wrote: http://android.git.kernel.org/?p=platform/packages/apps/Browser.git;a... On Sun, Aug 29, 2010 at 7:20 AM, zohar lerman lirazo...@gmail.com wrote: Hi, Where can i find the Android Browser source code? Thanks Zohar -- 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 -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9 Available! -- 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] Cannot play HTML5 video using webview
Hi, I haven't been able to get the following html5 code to work: html head /head body video width=400 height=300 controls src=myvideo.m4v /video /body /html Notes: * I can see the video only with android browser but when i run it in WebView i see nothing. * I also tried with the onclick=this.play(); but it is not working * when i load http://html5test.com/; i saw the all of the video formats are not supported * My code is SDK 1.5 and I am using HTC dream (SDK 1.5) and Nexus one (SDK 2.2) Please help Zohar -- 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] Does WebView Support html5 video?
Can I load in Webview page that use html5 video tag? -Z -- 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] Can we determine Connection type information from the OS?
I need to find is it 3G or WIFI connection - -- 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] Jar in Jar
Hi, I am creating new Android widget for other users to use. I created JAR file from my project and it is working as expected when other users and this jar to their project. I am trying to enrich the widget and for that i am using other jar. So my JAR include another jar, and only my code can access to that jar. The problem is where user use my jar and it reach to the line where i call to the other jar it crash with verifyError exception (on SDK 1.5 ) and NoClassDefFoundErro (on SDK 2.1) My jar manifest file includes: Class-Path: lib/otherJar.jar any idea? Is it possible to add jar into jar? thanks -Z -- 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: Jar in Jar
I dont need to access members of the inner jar from outsize just from my code that in the outer jar. Is it possible or extracting is the only solution? On Jul 28, 7:06 pm, DanH danhi...@ieee.org wrote: You can add a jar to a jar. You just can't (easily) access members in the inner jar without extracting it first. On Jul 28, 9:12 am, zohar lerman lirazo...@gmail.com wrote: Hi, I am creating new Android widget for other users to use. I created JAR file from my project and it is working as expected when other users and this jar to their project. I am trying to enrich the widget and for that i am using other jar. So my JAR include another jar, and only my code can access to that jar. The problem is where user use my jar and it reach to the line where i call to the other jar it crash with verifyError exception (on SDK 1.5 ) and NoClassDefFoundErro (on SDK 2.1) My jar manifest file includes: Class-Path: lib/otherJar.jar any idea? Is it possible to add jar into jar? thanks -Z -- 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] Sorry, this video cannot be played on Nexus one 2.2
Hi, I recently upgraded My Nexus one 2.1 to Nexus one 2.2. Since then i have problem to play mov files. I get Sorry, this video cannot be played error message. Intent myIntent = new Intent(Intent.ACTION_VIEW); Uri u = Uri.parse(url); myIntent.setDataAndType(u, video/*); try { context.startActivity(myIntent); } catch (ActivityNotFoundException e) { Log.e(MyTag, cannot initiate video, e); } any Idea? -- 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: Sorry, this video cannot be played on Nexus one 2.2
Can you please provide an example? On Jul 19, 2:02 pm, Mark Murphy mmur...@commonsware.com wrote: Try using a real MIME type. Real MIME types do not have asterisks. On Mon, Jul 19, 2010 at 6:15 AM, zohar lerman lirazo...@gmail.com wrote: Hi, I recently upgraded My Nexus one 2.1 to Nexus one 2.2. Since then i have problem to play mov files. I get Sorry, this video cannot be played error message. Intent myIntent = new Intent(Intent.ACTION_VIEW); Uri u = Uri.parse(url); myIntent.setDataAndType(u, video/*); try { context.startActivity(myIntent); } catch (ActivityNotFoundException e) { Log.e(MyTag, cannot initiate video, e); } any Idea? -- 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 -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.1 Available! -- 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: Sorry, this video cannot be played on Nexus one 2.2
Thanks but it still not working. Any other idea? On Jul 19, 2:38 pm, Mark Murphy mmur...@commonsware.com wrote: On Mon, Jul 19, 2010 at 7:31 AM, zohar lerman lirazo...@gmail.com wrote: Can you please provide an example? An example of a MIME type without an asterisk is: video/quicktime -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.1 Available! -- 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: Sorry, this video cannot be played on Nexus one 2.2
I guess it is the second option since the same file works as expected on htc 1.5 On Jul 19, 3:01 pm, Mark Murphy mmur...@commonsware.com wrote: On Mon, Jul 19, 2010 at 7:53 AM, zohar lerman lirazo...@gmail.com wrote: Thanks but it still not working. Any other idea? Not really. If it is getting to a video player activity, and that activity is complaining that it cannot play the video, the most likely scenarios are that the video file is corrupt or there is a bug/regression in Android. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.1 Available! -- 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: Question About animation
thanks On Jun 30, 11:02 am, Romain Guy romain...@android.com wrote: You simply need to use setFillAfter(true). On Wed, Jun 30, 2010 at 12:59 AM, zohar lerman lirazo...@gmail.com wrote: Hi, I want to move a view from location (x,y) to (x1,y1). What is the best way to do it? I tried using the following code but it cannot stay at the last point (x1,y1),it always translate back: TranslateAnimation anim = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f); anim.setDuration(100); anim.setInterpolator(new LinearInterpolator()); this.startAnimation(anim); any suggestions? thanks Z -- 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 -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- 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] Google Maps App
Hi, I have several Android devices and each of them has different version of Google Maps: 3.0 in HTC G1, 3.1.1 in HTC Dream and 3.4 in Nexus one and Motorola Droid. When i use the following code: Intent myIntent = new Intent(Intent.ACTION_VIEW,Uri.parse(geo:0,0? q=Starbucks)); I get different behavior on the devices: On the latest versions of Google Maps application I see a map the term centered around my current location with a reasonable zoom radius while in Google Maps 3.0 I see list of results and button to the map. Is there a way to get the same behavior on all devices? of course i prefer the behavior of the latest versions 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] Re: ListView problem - items are shrank when while scrolling the view
Thanks for your help but it still shrink the image. about the criteria: I have different criteria but to make it easy to explain i prefer this one. On Jun 9, 8:56 am, mort m...@sto-helit.de wrote: I think you should work with getItemViewType(int position) and getViewTypeCount(), so Android knows there are different views for the items. Example (untested ugly style): public int getItemViewType(int position) { if ( position == 5 ) return 1; else return 0; } public int getItemViewTypeCount() { return 2; } public View getView(int position, View convertView, ViewGroup parent) { if ( getItemViewType(position) == 1 ) { return imgView; } else { TextView tv; if ( convertView != null ) { // Do this to save memory! tv = (TextView) convertView; } else { tv = new TextView(TestActivity.this); } tv.setText(Entry #+position); tv.setMinimumHeight(50); tv.setBackgroundColor(Color.DKGRAY); return tv; } } btw: Querying a fixed position might be a bad idea in the long run. Isn't there a better criteria? -- 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: ListView problem - items are shrank when while scrolling the view
Hi Mort, I just tried it again and i changed getItemViewTypeCount to getViewTypeCount and it is working as expected. Actually it even fixed some other issues that I had with the ListView thanks On Jun 9, 10:38 am, zohar lerman lirazo...@gmail.com wrote: Thanks for your help but it still shrink the image. about the criteria: I have different criteria but to make it easy to explain i prefer this one. On Jun 9, 8:56 am, mort m...@sto-helit.de wrote: I think you should work with getItemViewType(int position) and getViewTypeCount(), so Android knows there are different views for the items. Example (untested ugly style): public int getItemViewType(int position) { if ( position == 5 ) return 1; else return 0; } public int getItemViewTypeCount() { return 2; } public View getView(int position, View convertView, ViewGroup parent) { if ( getItemViewType(position) == 1 ) { return imgView; } else { TextView tv; if ( convertView != null ) { // Do this to save memory! tv = (TextView) convertView; } else { tv = new TextView(TestActivity.this); } tv.setText(Entry #+position); tv.setMinimumHeight(50); tv.setBackgroundColor(Color.DKGRAY); return tv; } } btw: Querying a fixed position might be a bad idea in the long run. Isn't there a better criteria? -- 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 problem - items are shrank when while scrolling the view
Hi, I found strange behavior in ListView. I have ListView of TextView except from one entry that contains ImageView. when i on of the items is touched and scroll up and down the image is re-sized to about 2/3 its original size! Usually, the image remains in this smaller size when the user lifts his finger and stops scrolling. The original size can be restored by tapping your finger on any of the empty list cells. any idea? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android xmlns:app=http://schemas.android.com/apk/res/com.jumptap.test; android:layout_width=fill_parent android:layout_height=wrap_content ListView android:id=@+id/myList android:layout_width=fill_parent android:layout_height=300dip/ /RelativeLayout ListView lv = (ListView)findViewById(R.id.myList); lv.setAdapter(new BaseAdapter() { @Override public View getView(int position, View convertView, ViewGroup parent) { if (position==5) { return imgView; } else { TextView tv = new TextView(TestActivity.this); tv.setText(Entry #+position); tv.setMinimumHeight(50); tv.setBackgroundColor(Color.DKGRAY); return tv; } } @Override public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Override public Object getItem(int position) { // TODO Auto-generated method stub return null; } @Override public int getCount() { return 15; } }); -- 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: ListView problem - items are shrank when while scrolling the view
I forgot to mention that it happens in SDK 2.1 but not in SDK 1.5 On Jun 8, 11:03 am, zohar lerman lirazo...@gmail.com wrote: Hi, I found strange behavior in ListView. I have ListView of TextView except from one entry that contains ImageView. when i on of the items is touched and scroll up and down the image is re-sized to about 2/3 its original size! Usually, the image remains in this smaller size when the user lifts his finger and stops scrolling. The original size can be restored by tapping your finger on any of the empty list cells. any idea? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android xmlns:app=http://schemas.android.com/apk/res/com.jumptap.test; android:layout_width=fill_parent android:layout_height=wrap_content ListView android:id=@+id/myList android:layout_width=fill_parent android:layout_height=300dip/ /RelativeLayout ListView lv = (ListView)findViewById(R.id.myList); lv.setAdapter(new BaseAdapter() { @Override public View getView(int position, View convertView, ViewGroup parent) { if (position==5) { return imgView; } else { TextView tv = new TextView(TestActivity.this); tv.setText(Entry #+position); tv.setMinimumHeight(50); tv.setBackgroundColor(Color.DKGRAY); return tv; } } @Override public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Override public Object getItem(int position) { // TODO Auto-generated method stub return null; } @Override public int getCount() { return 15; } }); -- 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] Sorry, this video cannot be played
Hi, i am trying to open an youtube url but i get 'Sorry, this video cannot be played' message. It is not consistent and happend on htc ( dream and hero ) 1.5 devices but not on motorola droid. the code i am using is: Intent myIntent = new Intent(Intent.ACTION_VIEW,Uri.parse(http:// www.youtube.com/watch?v=zP0sqRMzkwo)); context.startActivity(myIntent); 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
[android-developers] You tube player class name
Hi , I found that there is difference in class name of the YouTube player between devices: Some call it ‘com.google.android.youtube.PlayerActivity’ and some ‘com.google.android.youtube.YouTubePlayer’ My question is: Is there a way to retrieve the class name? 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] Re: You tube player class name
SO how do i open the you tube player? I hold youtube url (http://www.youtube.com/watch?v=dMH0bHeiRNg) and i want to show it directly in youtube player without opening the browser first? On May 24, 2:31 pm, Mark Murphy mmur...@commonsware.com wrote: zohar lerman wrote: Hi , I found that there is difference in class name of the YouTube player between devices: Some call it ‘com.google.android.youtube.PlayerActivity’ and some ‘com.google.android.youtube.YouTubePlayer’ My question is: Is there a way to retrieve the class name? The YouTube activity is not part of the SDK. You should not be relying upon it even existing on a device, let alone having a specific class as its implementation. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 Market Place
Is it possible to pass the android market place parameters for later use for example: request id? -- 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: How to unregister listener after application get closed
thanks On Apr 28, 5:42 pm, Mark Murphy mmur...@commonsware.com wrote: zohar lerman wrote: First thanks for your quick responses. Second I have few more questions 1. in your second suggestion is it possible ( and if yes how) to end the service later ( by user request) Call stopService(). 2. in your third suggestion is it possible to start the broadcast receiver by demand and the same question as in bullet 1 can i stop it later You would need to use PackageManager to enable and disable your manifest-registered BroadcastReceiver component. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.0 Available! -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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] How to unregister listener after application get closed
Hi, I am writing an application that listens to phone calls and perform some tasks when phone call arrives. The Application contains one activity which includes 2 buttons ‘Start’ and ‘Stop’ (where starts register the listener and stops unregister it – see code below). The problem starts when the application is closed ( onDestroy is called ). If the user pressed on the start button and exit from the application the listener still working (which is the expected behavior) but from now it is impossible to unregister the listener since launching new instance of the application create new instance of phoneListener. My question is: 1. Is there better way to implement my requirement? 2. Can I save the phoneListener object and reload It on application creation? 3. Any other idea? Thanks ((Button) findViewById(R.id.Start)).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { telephonyManager.listen(phoneListener, PhoneStateListener.LISTEN_CALL_STATE); } }); ((Button) findViewById(R.id.Stop)).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { telephonyManager.listen(phoneListener, PhoneStateListener.LISTEN_NONE); } }); -- 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: How to unregister listener after application get closed
This is my temporary solution but i want to be able to listen the phone event even when the application is closed ( until the user will ask to stop the this service) On Apr 28, 4:44 pm, Anurag Singh anusingh...@gmail.com wrote: Why dont you put your code in OnDestry. like OnDestroy() { telephonyManager.listen(phoneListener, PhoneStateListener.LISTEN_NONE); } - Anurag Singh On Wed, Apr 28, 2010 at 7:07 PM, zohar lerman lirazo...@gmail.com wrote: Hi, I am writing an application that listens to phone calls and perform some tasks when phone call arrives. The Application contains one activity which includes 2 buttons ‘Start’ and ‘Stop’ (where starts register the listener and stops unregister it – see code below). The problem starts when the application is closed ( onDestroy is called ). If the user pressed on the start button and exit from the application the listener still working (which is the expected behavior) but from now it is impossible to unregister the listener since launching new instance of the application create new instance of phoneListener. My question is: 1. Is there better way to implement my requirement? 2. Can I save the phoneListener object and reload It on application creation? 3. Any other idea? Thanks ((Button) findViewById(R.id.Start)).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { telephonyManager.listen(phoneListener, PhoneStateListener.LISTEN_CALL_STATE); } }); ((Button) findViewById(R.id.Stop)).setOnClickListener(new View.OnClickListener() { public void onClick(View v) { telephonyManager.listen(phoneListener, PhoneStateListener.LISTEN_NONE); } }); -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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: How to unregister listener after application get closed
Sorry for the misunderstanding but i am not using service. As i said in the initial post The Application contains one activity which includes 2 buttons ‘Start’ and ‘Stop’ On Apr 28, 5:02 pm, Mark Murphy mmur...@commonsware.com wrote: zohar lerman wrote: This is my temporary solution but i want to be able to listen the phone event even when the application is closed ( until the user will ask to stop the this service) From your original post, you do not have a service. If you have a service, unregister the listener in onDestroy() of the service. You might also consider switching to watch for the corresponding broadcast Intents, instead of keeping a service in memory all the time. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.0 Available! -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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: How to unregister listener after application get closed
First thanks for your quick responses. Second I have few more questions 1. in your second suggestion is it possible ( and if yes how) to end the service later ( by user request) 2. in your third suggestion is it possible to start the broadcast receiver by demand and the same question as in bullet 1 can i stop it later On Apr 28, 5:22 pm, Mark Murphy mmur...@commonsware.com wrote: zohar lerman wrote: Sorry for the misunderstanding but i am not using service. As i said in the initial post The Application contains one activity which includes 2 buttons ‘Start’ and ‘Stop’ Right. You cannot, should not, and must not leave a listener attached after an activity ends. You will leak memory and cause your users significant pain. Your options are: 1. Go with the earlier advice, unregister your listeners in onDestroy(), and do not listen the phone event even when the application is closed 2. Use a service, have the service have your listener, and have the service continue operating after the activities end 3. Listen for broadcast Intents for phone state changes, instead of using a listener -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android Consulting:http://commonsware.com/consulting -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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] How to get Linux version and manufacturer name
Hi, I am using SDK 1.5 and I need to retrieve the linux version and the manufacturer name. please help. Zohar -- 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 To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.