[android-developers] Re: Is it possible to start an application programmatically?
Just use startActivity(), possibly with the NEW_TASK flag. You can look at the home screen sample code in the SDK for an example. On Wed, Mar 25, 2009 at 10:45 PM, Joseph Teo josephteo2...@gmail.comwrote: Hi there... I know u can start a program using the adb shell... BUT I am trying to write a program which is able to start another application (e.g. Browser or Dialer or Maps etc) programmatically (from the program)... is it possible to do so in the program? If so, can someone kindly post some code snippets here of how to do this? Many many thanks in advance!! Cheers, Joseph -- Dianne Hackborn Android framework engineer hack...@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] Re: Is it possible to start an application programmatically?
ah ok... cool... Many thanks Dianne! :) On Thu, Mar 26, 2009 at 2:02 PM, Dianne Hackborn hack...@android.comwrote: Just use startActivity(), possibly with the NEW_TASK flag. You can look at the home screen sample code in the SDK for an example. On Wed, Mar 25, 2009 at 10:45 PM, Joseph Teo josephteo2...@gmail.comwrote: Hi there... I know u can start a program using the adb shell... BUT I am trying to write a program which is able to start another application (e.g. Browser or Dialer or Maps etc) programmatically (from the program)... is it possible to do so in the program? If so, can someone kindly post some code snippets here of how to do this? Many many thanks in advance!! Cheers, Joseph -- Dianne Hackborn Android framework engineer hack...@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] Re: Singleton in different service which share same process
got the some clues, if I add com.example.base into BOOTCLASSPATH , it resolved. but every process will map my jar, does we have better solution? On Mar 26, 11:45 am, Jove jove.c...@gmail.com wrote: Maps of my process, it's strange. com.example.base.jar is mapped twice. :( 41036000-41037000 r--s 1f:00 291 /system/framework/ com.example.base.jar 41037000-41038000 r--s 1f:01 780 /data/dalvik-cache/ sys...@framew...@com.example.base@classes.dex 41038000-4104 r--s 1f:01 536 /data/dalvik-cache/ sys...@a...@examplekeypad@classes.dex 4104-41041000 rw-s 00:08 837 /MemoryHeapBase (deleted) 41041000-41042000 r--s 1f:00 291 /system/framework/ com.example.base.jar 41042000-41043000 r--s 1f:01 780 /data/dalvik-cache/ sys...@framew...@com.example.base@classes.dex On Mar 26, 10:27 am, Jove jove.c...@gmail.com wrote: Hi, I didn't get what you mean. Could you explain more? I build system.img and sdk myself, so I can add my com.example.base.jar into system.img. Thanks, Jove On Mar 26, 3:14 am, Dianne Hackborn hack...@android.com wrote: You can't currently make your own library in the SDK, so the questions should be on android-platform. On Wed, Mar 25, 2009 at 11:14 AM, Mark Murphy mmur...@commonsware.comwrote: Jove wrote: Hi guys, I meet an issue. I have two services, both of them lies in separate apk, which run in same process. The two service share same jar file by uses-library method. The jar file implement a class, say test, is a singleton. But I found that two instance of test is created under this case, could anybody give me some tips? I want to ensure it's singleton. If you can explain a bit about how you are using uses-library for your own JAR files, I might be able to figure out why you are getting two instances. I have not seen much use of uses-library outside of the Google Maps situation. How are you using it in your application? -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Training:http://commonsware.com/training.html -- Dianne Hackborn Android framework engineer hack...@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] Hide a progressbar?
Hi I have added an indeterminate progress bar to my view and I want it to be displayed when the user clicks a button. The problem is as soon as the activity is loaded and the intent displayed, the progress bar is also displayed. I have used the setProgressBarVisibility(true); statement in the onClick method but the progress bar is displayed even without the onClick. Can someone please tell me how to keep the progress bar hidden till the button click happens? 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: Hide a progressbar?
in the onCreate set the Progresbar visibilty ProgressBar.setVisibilty(View.INVISIBLE) On Thu, Mar 26, 2009 at 12:34 PM, idev ideveloper...@gmail.com wrote: Hi I have added an indeterminate progress bar to my view and I want it to be displayed when the user clicks a button. The problem is as soon as the activity is loaded and the intent displayed, the progress bar is also displayed. I have used the setProgressBarVisibility(true); statement in the onClick method but the progress bar is displayed even without the onClick. Can someone please tell me how to keep the progress bar hidden till the button click happens? 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: Hide a progressbar?
Thanks :) On 26-Mar-09, at 12:43 PM, for android wrote: in the onCreate set the Progresbar visibilty ProgressBar.setVisibilty(View.INVISIBLE) On Thu, Mar 26, 2009 at 12:34 PM, idev ideveloper...@gmail.com wrote: Hi I have added an indeterminate progress bar to my view and I want it to be displayed when the user clicks a button. The problem is as soon as the activity is loaded and the intent displayed, the progress bar is also displayed. I have used the setProgressBarVisibility(true); statement in the onClick method but the progress bar is displayed even without the onClick. Can someone please tell me how to keep the progress bar hidden till the button click happens? 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] Developing absolute layout - no drag drop click drag in eclipse ??
Hi I am developing an application which uses absolute layout with image views. I am not able to click and drag the images in the layout preview in eclipse. Is there a setting which can enable that ? --~--~-~--~~~---~--~~ 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: written file not found
Probably, that is because they cannot browse /data due to security restrictions. What permissions do i need to see all files on the device? tools like ASTRO have -i hope so- the permissions for reading all self written files on my device. maybe my application has not enough permissions? i set WRITE_OWNER_DATA but i wasn't sure weather i need it. They are in the same spot on the device as they are in the emulator. You just cannot browse to them. However, you can use adb pull to download them. I thought that the adb pull is a tool for eclipse and the emulator. how can i use that on the g1? I think i need root for that, right? --~--~-~--~~~---~--~~ 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: contacting commenters?
No, unfortunately it is a one way communication. Hopefully that will change in the future. I think this topic is excessively discussed on the android-discuss mailing list. Maybe you should post follow-ups there. On Thu, Mar 26, 2009 at 5:34 AM, Bob bshumsk...@yahoo.com wrote: Hi, Is there any way to contact someone who has asked a question in a comment about your app on the android marketplace? Thanks, Bob --~--~-~--~~~---~--~~ 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: Shutdown notification?
I would like to perform a task just before the phone is shut down. I thought that Application#onTerminate would be called but that does not seem to be the case. Is there a broadcast intent when the phone is going to shutdown? If not, how to run a task just before the phone is turned off? Anyone? --~--~-~--~~~---~--~~ 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: SMS encoding?? how can i receive Chinese SMS???
does it related to encoding or font? how you can send sms by eclipse? 2009/3/26 SinFrancis kyowxf2...@gmail.com I wanna receive Chinese SMS , i use eclipse send Chinese SMS to emulator, but the message all like this ?, if the English SMS, not prob. I wanna know the encoding of SMS in Android. --~--~-~--~~~---~--~~ 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] new soft keyboard
Hi. Is it possible to replace the soft keyboard by writing just an Activity, or is it hardwired into the framework? I probably think the latter from looking at various stuff, but I thought Id double check. 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] branchs in android
while I dig in the cupcake branch? I founf there are other branches, for example donut, master, cdma- import. Where I can find more detail information about these branchs? 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: Screen Orientation.
int orientation = getResources().getConfiguration().orientation On Mar 25, 8:12 am, Dianne Hackborn hack...@android.com wrote: Sorry I made a mistake, use getResources().getConfiguration(). On Tue, Mar 24, 2009 at 10:43 PM, for android forandr...@gmail.com wrote: Does that mean from the DisplayMetrics we need to check from the height and width? On Wed, Mar 25, 2009 at 10:55 AM, Dianne Hackborn hack...@android.comwrote: That returns the orientation mode your activity has requested. The actual current orientation is in getResources().getDisplayMetrics(). On Tue, Mar 24, 2009 at 10:01 PM, for android forandr...@gmail.comwrote: getRequestedOrientation() On Wed, Mar 25, 2009 at 9:34 AM, Suman ipeg.stud...@gmail.com wrote: Hi all... Thanks for replies. Can any one tell me by which method i can check the screen orientation? I mean i want to check whether it is land-scap mode or portrait mode. Thanks in advance. Suman. -- Dianne Hackborn Android framework engineer hack...@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. -- Dianne Hackborn Android framework engineer hack...@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.- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: branchs in android
Find it here: http://groups.google.com/group/android-platform/browse_thread/thread/ebd5800764427d70 Cheers, Rajesh.S On Mar 26, 8:44 am, a...@tw schosnab...@gmail.com wrote: while I dig in the cupcake branch? I founf there are other branches, for example donut, master, cdma- import. Where I can find more detail information about these branchs? 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: Multi Touch support in Android
No. Not in the current official API. There are unofficial extensions as the hardware understands two peak touch points. So kind of dual- touch is available. (Search xda-developers forum for details.) Google might not go in that direction at least till Palm officially wins it in court. As of now it is patented by Apple. On Mar 26, 4:22 am, Pratap ajit@gmail.com wrote: Hi I want to implement multi-touch gesture detection in my application. Does android provides support multi-touch? If yes, then how can we simulate multi-touch on emulator. If no, then is there any hack, which we can use to get multi finger touch in our application. Kindly provide suggestions 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: Multi Touch support in Android
And instead of zooming with two fingers, I have seen new map app on HTC-Magic using a rotate-to-zoom (in/out). It would be part of the upcoming APIs. On Mar 26, 9:45 am, Rajesh S rajeshs...@gmail.com wrote: No. Not in the current official API. There are unofficial extensions as the hardware understands two peak touch points. So kind of dual- touch is available. (Search xda-developers forum for details.) Google might not go in that direction at least till Palm officially wins it in court. As of now it is patented by Apple. On Mar 26, 4:22 am, Pratap ajit@gmail.com wrote: Hi I want to implement multi-touch gesture detection in my application. Does android provides support multi-touch? If yes, then how can we simulate multi-touch on emulator. If no, then is there any hack, which we can use to get multi finger touch in our application. Kindly provide suggestions 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: Anything on Android that can do smooth scrolling?
On Wed, Mar 25, 2009 at 11:02 PM, Romain Guy romain...@google.com wrote: The trick is simple: avoid any allocation that might trigger a GC. It's not that simple at all. In fact, it is *impossible* on Android, or any other mobile OS which allows background processes. I've already said this once -- even though your game can be tuned to the max, nothing prevents *other* apps from triggering GC. That is, in my game, I *never*, *ever* do any allocation after startup. However, other background processes do trigger GC, and voila - my game stutters for a bit when GC kicks in. Compare to iPhone, which disallows background processing and the foreground app is never interrupted. Cheers --~--~-~--~~~---~--~~ 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 Invoke Maps application from nay other application
Hello, I want to invoke the (Specifically) Android maps application from My own application. Is there any way by which I can do that? Thanks in Advance. Regards, Swapnil Dalal --~--~-~--~~~---~--~~ 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] Invoking Maps application
Hello all, Is there any way of Invoking Maps application from any other application? Can I do that? If possible can you tell me how to proceed with that. Thanks in Advance. Regards, Swapnil Dalal. --~--~-~--~~~---~--~~ 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 Invoke Maps application from nay other application
geo:*latitude*,*longitude* geo:*latitude*,*longitude*?z=*zoom* geo:0,0?q=*my+street+address* geo:0,0?q=*business+near+city http://developer.android.com/guide/appendix/g-app-intents.html * On Thu, Mar 26, 2009 at 3:27 PM, swapnil swapnil.da...@gmail.com wrote: Hello, I want to invoke the (Specifically) Android maps application from My own application. Is there any way by which I can do that? Thanks in Advance. Regards, Swapnil Dalal --~--~-~--~~~---~--~~ 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 read MMS messages? Possible or not?
No news? So i guess this means, no MMS for us? No explanation or hint? :( Reading/Writing MMS is crucial for an application i want to develop. Regards, Sebastian On 24 Mrz., 16:01, Sebastian flashbus...@gmail.com wrote: Hello, i am unable to find updated information on how to readmmsmessages in android. I am able to query content://sms and content://mms. Content://mmscontains a bunch of columns which i don't find information for. Atleast the returned Cursors seem to point to themmsin my phone. Now, how can i read the actualmmsdata? Is it intended that the official documentation contains no information at all?! As far as i understand it: The included Messaging/MMSapplication on my G1 is not part of android (the open source project)? So it's closed source and provided to the carrier by google/whoever? It'd be really nice to have some statement on this because i need to know whether i can readmmsor not (which would be ridiculous). Regards, Sebastian --~--~-~--~~~---~--~~ 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 add radiobuttons in menu structure
Is this rocket since or why can nobody help me? :-( --~--~-~--~~~---~--~~ 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 prevent the special application of android to access the network?
Access is granted while installing. You may choose to go through the list of things accessed and stop installing. I don't think there is any other level of app specific access control available at present. Settings work in a global context. So, say once the GPS is enabled (through settings or other apps), any installed app could use it (if the app was granted permission to while installing). I too would love to see some such firewall kind of stuff in future but this will need core changes and can't be a simple security / gateway / firewall app. Cheers, Rajesh.S On Mar 26, 5:36 am, trust_chen chen trustc...@gmail.com wrote: how to prevent the special application of android to access the network? 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] can we save mapview data in application database?
hello can we save mapview data in application database, if so what is data format for storing mapview, location data. thank you --~--~-~--~~~---~--~~ 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: SMS encoding?? how can i receive Chinese SMS???
yes, i send Chinese sms use eclipse, but receive data not correct. in source code , the data encoding is USC2, when i send by eclipse , convert data USC2 to GBK, also not correct. 2009/3/26 Jove Chia jove.c...@gmail.com does it related to encoding or font? how you can send sms by eclipse? 2009/3/26 SinFrancis kyowxf2...@gmail.com I wanna receive Chinese SMS , i use eclipse send Chinese SMS to emulator, but the message all like this ?, if the English SMS, not prob. I wanna know the encoding of SMS in Android. -- Best Regards! 王心锋 Software Engineer/AndroidOS Creator Email: kyowxf2...@gmail.com| Web: http://androidos.cc| Community: http://androidos.cc/bbs Tel:0551-2341751 Mobile: 13485512230 Address: 34#503,7#602 ShuNanTingYuan, WangJiang Road,HeFei City,An Hui Province --~--~-~--~~~---~--~~ 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 Projects Promotion Pages Online
*Yeah. Recently in China there have been many web pages for Android, even if not yet a single Android phone is officially released in China. The problem is, the domestic Android software industry is quite legged behind. It can not be imagined that Android would have the chance in China if the apps couldn't catch up. The good thing is, there are already or would be many apps in the global basis, particularly from the western countries like the U.S.A, the birth place of Android. Therefore, it is quite natural for us wonder how a bridge can be built between the supply and demand ... Obviously, the official Android Market is not doing good enough, here I mean, in that only English language is presented. Even, the developers have spare little attention for the East. It can be speculated that so far most of the apps are only in English. ... Maybe I am over-worrying ... By the way, the pages of Android software promotion http://www.aidiji.comwere updated and totally English-friendly. *2009/3/23 mercury xu xumerc...@gmail.com Hi Gollum Of course, there are lots of people pay more attention for this OS in China,and pay lots of time for develop and desinge much more softwares,not only at application programs but also OS Device drivers,such as me.haha~~also,in china, there are lots of websites for android's fans to communication and discussion ,such as www.androidin.com , www.android123.com,of course, my website www.51wince.com. It will more popular at the future. Good luck and best regards! Mercury From 51wince.com 2009/3/23 Gollum [www.aidiji.com] www.aidiji@gmail.com *Thanks, man. I do hope people pay more attention on the market of China. For now, China Mobile is having 6000 millions of users and would definitely boost the Android soon as the major strategy. Therefore, I am so recommending that every Android app should make a version for Chinese when domestical software is nearly an vacuum. Well, does anybody care at all?* 2009/3/22 mercury xu xumerc...@gmail.com Hi Gollum Congratulations! Best wishes for your website! Best regards! Mercury From 51wince.com 2009/3/22 Gollum [www.aidiji.com] www.aidiji@gmail.com Dear all, AiDiJi.com http://www.aidiji.com/ (http://www.aidiji.com) has brought online the Android projects promotion pages, where companies and individuals can release their Android software products. The pages are mainly targeted at the market of China, which as you know, has the population of billions. Here, your product would have the audience on the billion scales, especially when in the near future (it is April as claimed) China Mobile, the dominant mobile operator within China, will launche the Android campaign with substantial Android phone products from many manufacturers. Besides, the promotion here is free to use without any revenue sharing, and will serve only as an index entry to your products’ pages to secure the payment if they charge. Meantime, AiDiJi.com would benefit somehow. In this win-win situation, what would you lose anyway? So please just try it out before you make the final decision, starting from the page as follows, Project Display: http://www.aidiji.com Project Release:http://www.aidiji.com/my.php Introduction with image demo: http://www.aidiji.com/viewtopic.php?f=13t=278 Thank you very much. -- www.aidiji.com - Where Android is hot! -- WWW.51WinCE.COM!Burr good! -- www.aidiji.com - Andoroid Developing Application Forum (in Chinese Language) -- WWW.51WinCE.COM!Burr good! -- www.aidiji.com - where Android‘s hot! --~--~-~--~~~---~--~~ 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图书作者(限于中国人和华 人)
胡先生: 您好! 我也有这方面的打算,整理过一些资料,原打算6月底开始正式整理。 胡亚军 2009/3/24 huzoor h...@phei.com.cn 大家好! 开门见山:Android在国际上吸引眼球很久了,国内关注Android也有相当一段时间。我们与多家企业联系过,有很好的推广 Android图书的途径。现在国内缺乏Android中文图书,我们关注这个市场很久了,希望找到合适的Android图书作者。希望有意者可以和我 联系,在电子工业出版社出版精品图书。 高级策划编辑: 胡辛征 --~--~-~--~~~---~--~~ 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 display text just over ProgressBar?
I am using android 1.0 sdk and I am not getting progress.setMessage API. Can I get any work around? BREW implements decorator design pattern which helps in getting the two widget functionality into one. some text on a progress bar, that's all I need. On Mar 21, 4:18 pm, T patel trushs...@gmail.com wrote: On Mar 10, 9:17 pm, David Yue a52...@motorola.com wrote: Hi, I am trying to implement a ProgressBar with text over it. Below is my general idea: In layout *.xml file, I define it as below: ProgressBar android:id=@+id/progress_ID style=?android:attr/progressBarStyleHorizontal android:layout_width=200dip android:layout_height=wrap_content android:max=100 android:progress=50 / In Java code, I do like this: final ProgressBar progress; progress = (ProgressBar) v.findViewById(R.id.progress_ID); progress.setProgress(99); BUT I have no idea how to display a text like 50% over the ProgressBar. I gone through progress realted mehtods, not found useful refrence. Do you have any idea? or I must use another way? thanks a lot! BR, David try this code progress = (ProgressBar) v.findViewById(R.id.progress_ID); progress.setProgress(99); then try progress.setMessage(0%); .. //some process load ... progress.setMessage(50%); ... //some process load progress.setMessage(100%); --~--~-~--~~~---~--~~ 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: Anything on Android that can do smooth scrolling?
I've also proposed a solution to this - adding a permission for apps to request that they run alone, uninterrupted by other processes. That is, the app can request a permission, demanding that the app can only be interrupted by an external event, such as phone call, all other services and background processes (other than the ones the OS can't go without) are paused when app is running. I know it's quite tricky to implement this, because, for example, when an SMS is received it needs to be stored in the database, and this will require some memory, which will need to be discarded, when the SMS is written to the database, and this will trigger GC. However, when such a message is received, and the OS knows that an app with the special permission runs in the foreground, it could delay the GC either until: - the app itself allocates memory (no matter if it might not be actually GC'ed until the app finishes) OR - the systems goes pretty low on memory At least, non-stock services (i.e. services, developed by 3rd parties) can be suspended during the lifetime of an application requesting the special permission. Cheers On Thu, Mar 26, 2009 at 11:51 AM, Stoyan Damov stoyan.da...@gmail.com wrote: On Wed, Mar 25, 2009 at 11:02 PM, Romain Guy romain...@google.com wrote: The trick is simple: avoid any allocation that might trigger a GC. It's not that simple at all. In fact, it is *impossible* on Android, or any other mobile OS which allows background processes. I've already said this once -- even though your game can be tuned to the max, nothing prevents *other* apps from triggering GC. That is, in my game, I *never*, *ever* do any allocation after startup. However, other background processes do trigger GC, and voila - my game stutters for a bit when GC kicks in. Compare to iPhone, which disallows background processing and the foreground app is never interrupted. Cheers --~--~-~--~~~---~--~~ 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 any one who provide a gps test app?
Hi, Can any one who have develop a gps app? I'm looking for a app to test my android device. my email: luodali...@gmail.com Thanks, Nio --~--~-~--~~~---~--~~ 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: Is it possible to pick contacts from a single group ?
And, for reference, the recipe above is only for system groups (hence the /system_id in the url). If you want to display a non-system group, try this: uri = Uri.parse(content://contacts/groups/ + name/ + Uri.encode(mGroupName) + // eg, Starred in Android - values from android.provider.Contacts.Groups.NAME /members); Richard On Mar 25, 6:07 pm, jarkman jark...@gmail.com wrote: Well, I haven't found a way to launch the system picker for a specific group, so I've written a picker using a ListView and an URI of the form: Uri uri = Uri.parse(content://contacts/groups/system_id/ + Contacts.Groups.GROUP_MY_CONTACTS + /members); (with handy clue from here:http://groups.google.com/group/android-developers/browse_thread/threa... - thanks, Mike!) I can't help thinking there should be a way to use ACTION_PICK and this Uri to summon up a working picker, but I haven't found a way to make that go. Richard On Mar 23, 3:26 pm, jarkman jark...@gmail.com wrote: I'm using ACTION_PICK to show a contact picker: startActivityForResult( new Intent(Intent.ACTION_PICK, Uri.parse (content://contacts/people) ) ,RESULT_PICK_CONTACT_REQUEST); I'd really like to be showing only contacts from the My Contacts group, rather than the list which includes all the auto-generated contacts. I had hoped to find an Extra to specify the group, but I can't find any sign of one. Is there any way to pick a contact from a specified group, or do I need to write my own picker ? Thanks, Richard --~--~-~--~~~---~--~~ 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: Anything on Android that can do smooth scrolling?
Thanks for the responses guys. My question was more like how come its smooth in the picture viewer app despite running multi processes? Its the only 2d app I've found that does this correctly, but its reassuring to know it DOES work. Surface views seem good for static surfaces with moving objects on top, but bad for scrolling objects. Checking the picture viewer code again, I think they are using an oversided view with scrollto methods. I will try this later to see if this works better. On Mar 26, 11:26 am, Stoyan Damov stoyan.da...@gmail.com wrote: I've also proposed a solution to this - adding a permission for apps to request that they run alone, uninterrupted by other processes. That is, the app can request a permission, demanding that the app can only be interrupted by an external event, such as phone call, all other services and background processes (other than the ones the OS can't go without) are paused when app is running. I know it's quite tricky to implement this, because, for example, when an SMS is received it needs to be stored in the database, and this will require some memory, which will need to be discarded, when the SMS is written to the database, and this will trigger GC. However, when such a message is received, and the OS knows that an app with the special permission runs in the foreground, it could delay the GC either until: - the app itself allocates memory (no matter if it might not be actually GC'ed until the app finishes) OR - the systems goes pretty low on memory At least, non-stock services (i.e. services, developed by 3rd parties) can be suspended during the lifetime of an application requesting the special permission. Cheers On Thu, Mar 26, 2009 at 11:51 AM, Stoyan Damov stoyan.da...@gmail.com wrote: On Wed, Mar 25, 2009 at 11:02 PM, Romain Guy romain...@google.com wrote: The trick is simple: avoid any allocation that might trigger a GC. It's not that simple at all. In fact, it is *impossible* on Android, or any other mobile OS which allows background processes. I've already said this once -- even though your game can be tuned to the max, nothing prevents *other* apps from triggering GC. That is, in my game, I *never*, *ever* do any allocation after startup. However, other background processes do trigger GC, and voila - my game stutters for a bit when GC kicks in. Compare to iPhone, which disallows background processing and the foreground app is never interrupted. Cheers --~--~-~--~~~---~--~~ 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 display 2 ListViews on the screen at the same time
Thanks foryour good advise !! I shall explore ! On Mar 25, 3:51 pm, Mark Murphy mmur...@commonsware.com wrote: xinit wrote: For Example if I have two ListViews one ontop of another, for me to scroll the list in the bottomListViewI have to navigate all the way down through all items inListView1 before entering or focussin on List View2. Simple: don't use two lists on the screen at one time. -- use a Spinner for one -- use tabs to put them on separate tabs -- use ViewFlipper to flip between the two lists based on a button click or option menu choice -- use multiple activities, one list per activity -- Mark Murphy (a Commons Guy)http://commonsware.com Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ 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: need some collection help
Josh wrote: I want to store objects into an array or collection(whichever is best suited to this in dalvik). You mean like the ones in the java.util package? the objects are basically just VO's all of the same class that i want to keep track of. What's a VO? -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ 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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: written file not found
Mak wrote: Probably, that is because they cannot browse /data due to security restrictions. What permissions do i need to see all files on the device? tools like ASTRO have -i hope so- the permissions for reading all self written files on my device. Probably not. Or, more accurately, they have permissions to read all self written files, but not necessarily browse the directories that contain them. maybe my application has not enough permissions? There are no permissions to say let my app read all files anywhere. I thought that the adb pull is a tool for eclipse and the emulator. how can i use that on the g1? You can't. My apologies, I thought your goal was to view the files. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ 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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: how to prevent the special application of android to access the network?
thank your reply. yes i want to implement an app like firewall which can control the apps that access network. the fee is expensive now. On Mar 26, 5:56 pm, Rajesh S rajeshs...@gmail.com wrote: Access is granted while installing. You may choose to go through the list of things accessed and stop installing. I don't think there is any other level of app specific access control available at present. Settings work in a global context. So, say once the GPS is enabled (through settings or other apps), any installed app could use it (if the app was granted permission to while installing). I too would love to see some such firewall kind of stuff in future but this will need core changes and can't be a simple security / gateway / firewall app. Cheers, Rajesh.S On Mar 26, 5:36 am, trust_chen chen trustc...@gmail.com wrote: how to prevent the special application of android to access the network? 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] Http GET method with extra headers
Hi Experts, i am trying a GET request to my server with some extra headers dont know how can i add header here is my code: DefaultHttpClient client = new DefaultHttpClient(); HttpGet method = null; HttpResponse resp = null; method = new HttpGet( new URI(url) ); } catch (Exception e) { e.printStackTrace(); } try { resp = client.execute(method); } catch (IOException e) { e.printStackTrace(); } /// i can add header like below but this shows me POST HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection(); String boundary = myboundary; httpConnection.setDoOutput(true); httpConnection.setDoInput(true); httpConnection.setUseCaches(false); //httpConnection.setRequestMethod(GET); httpConnection.setRequestProperty(Connection,Keep- Alive); httpConnection.setRequestProperty(Content-Type,multipart/form- data; boundary= + boundary); httpConnection.setRequestProperty(user-agent,this.user_agent); httpConnection.setRequestProperty(accept- language,this.accept_language); httpConnection.setRequestProperty(user-agent- id,this.user_agent_id); httpConnection.setAllowUserInteraction(true); httpConnection.setInstanceFollowRedirects(true); //httpConnection.connect(); DataOutputStream wr = new DataOutputStream (httpConnection.getOutputStream()); any solution to add header in GET? --~--~-~--~~~---~--~~ 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] HttpGet.addHeader
Hi Experts, i am trying to add header on HttpGet but it raise this exception InvocationTargetException here is my code: DefaultHttpClient client = new DefaultHttpClient(); HttpGet method = null; HttpResponse resp = null; String url = http://www.x.com/a.xml;; method.addHeader(Connection,Keep-Alive); /*method.addHeader(accept-language,this.accept_language); method.addHeader(user-agent-id,this.user_agent_id);*/ method = new HttpGet( new URI(url) ); i also used setHeader but same error please help me out --~--~-~--~~~---~--~~ 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] Decoupling localization and translation
Hi, I ran into a problem with the way Android resolves resource paths. Apparently the folders below are invalid: res/values-rAT res/values-rDE res/values-rGB What I am trying to do is decouple the localization of my application (mostly just urls to web-services i use) from the translation (mostly user interface strings), thus allowing a user to select locals like: de-rGB or en-rAT without actually creating all those synthetic folders. Right now I have 3 languages and 6 locales so it is still manageable, but as the number of languages and locales increase the number of directories will explode out of control. So I was wondering: 1. If anyone knows a workaround for this? A placeholder language code that resolves to any - something like res/values-xx-rAT? Or any other way around? 2. Is this a bug? Will those directories be supported in the near future? thanks for reading this far :), gesh. --~--~-~--~~~---~--~~ 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: photo picker Uri issue
cheers, did not know that about Drawables will use Bitmaps then. Thanks, Greg. On Mar 25, 3:23 pm, Streets Of Boston flyingdutc...@gmail.com wrote: This Uri is the logical (not physical) path used by the image content provider. If you want to get the physical path to the actual file on the SD- card, query this Uri: Cursor cursor = query(photoUri, new String[] {MediaStore.Images.ImageColumns.DATA}, null, null, null); String absoluteFilePath = cursor.getString(0); Now, absoluteFilePath is the physical path to your image, which you can use in Drawable.createFromPath Question: Why don't you create a Bitmap instead? ... InputStream is = getContentResolver().openInputStream(photoUri); Bitmap bm = BitmapFactory.decodeStream(is); ... is.close(); I ask this, because it is safer to cache Bitmaps instead of Drawables. If you cache Drawables, you run the risk of memory leaks. Drawables have handles to your activity and when your activity gets destroyed while your Drawables are still cached, your activiy will never be garbage collected -- memory leak. Bitmaps don't have this problem. They are basically byte-arrays with some behavior :). On Mar 25, 3:15 am, beachy beachy.g...@gmail.com wrote: In some code I call this; Intent photoPickerIntent = new Intent (Intent.ACTION_PICK); photoPickerIntent.setType(image/*); startActivityForResult(photoPickerIntent, 1); then implement this method protected void onActivityResult(int requestCode, int resultCode, Intent intent) { super.onActivityResult(requestCode, resultCode, intent); if (resultCode == RESULT_OK) { Uri photoUri = intent.getData(); Log.d(TAG, should be adding a photo); if (photoUri != null) { Log.d(TAG, photo uri is not blank); // do something with the content Uri //TODO figure out why this does not work!! Log.d(TAG, the photo URI is + photoUri.getPath()); Drawable thePic = Drawable.createFromPath (photoUri.getPath()); //thePic is Null if(thePic != null){ Log.d(TAG, the pic has loaded); myRecipe.addPic(thePic); ((RecipeAdapter)myListView.getAdapter ()).notifyDataSetChanged(); } } } } trying to get a image and load it in to a drawable object. The Uri that is returned seems logical 03-25 08:12:58.554: DEBUG/ConvertScaleScreen(174): the photo URI is / external/images/media/1 but when i start up a shell with adb the file location or even the root drive does not exitst, am I missing something here? should the be a symbolic link on the file system? --~--~-~--~~~---~--~~ 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 Sample Applcation URL Not working
Hi, I am try to get source from http://apps-for-android.googlecode.com/svn/trunk/ URL. But it not working. Anybody know new url. 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: HttpGet.addHeader
What happens if you do this instead: method.getParams().setParameter(http.useragent, this.user_agent_id); ? On Thu, Mar 26, 2009 at 2:54 PM, zeeshan genx...@gmail.com wrote: Hi Experts, i am trying to add header on HttpGet but it raise this exception InvocationTargetException here is my code: DefaultHttpClient client = new DefaultHttpClient(); HttpGet method = null; HttpResponse resp = null; String url = http://www.x.com/a.xml;; method.addHeader(Connection,Keep-Alive); /*method.addHeader(accept-language,this.accept_language); method.addHeader(user-agent-id,this.user_agent_id);*/ method = new HttpGet( new URI(url) ); i also used setHeader but same error please help me out --~--~-~--~~~---~--~~ 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: need some collection help
You mean like the ones in the java.util Yes, specifically java.util.collection What's a VO? A VO is basically a class that only contains properties(Value Objects). On Thu, Mar 26, 2009 at 4:53 AM, Mark Murphy mmur...@commonsware.comwrote: Josh wrote: I want to store objects into an array or collection(whichever is best suited to this in dalvik). You mean like the ones in the java.util package? the objects are basically just VO's all of the same class that i want to keep track of. What's a VO? -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ 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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Anything on Android that can do smooth scrolling?
On Thu, Mar 26, 2009 at 1:47 PM, admin.androidsl...@googlemail.com admin.androidsl...@googlemail.com wrote: Thanks for the responses guys. My question was more like how come its smooth in the picture viewer app despite running multi processes? Its the only 2d app I've found that does this correctly, but its reassuring to know it DOES work. Please, read carefully: Running multiple processes is not a problem. If, however, a process triggers GC you'll see stuttering in the picture viewer as well, and *any* application, no matter how great was it implemented. Let me explain what I'm talking about: There's a myFaves service on the G1. Apparently it tries to send an MMS once, or once in a while to T-Mobile. Because my G1 is unlocked and running on a different network, the MMS transmission fails. However, myFaves won't give up and will try sending the MMS. When I got my unlocked G1 December last year, it had the 1.0 firmware. Perhaps the myFaves service was running very very rarely because I've never seen my game stutter, even though many background processes were in fact running. That is, perhaps I was testing the game on the device when myFaves was not trying to send the MMS. When the OTA updated the firmware to 1.1, the myFaves service started to attempt to send an MMS to T-Mobile more often. This triggers GC for exactly 110 objects and N bytes of memory, and my game stutters *every* time the myFaves service is attempting to send an MMS (apparently, it will *always* try sending the god damn MMS because I'm not on T-Mobile's network). So, my point is not that background processes per se are the problem, but these who actually perform any work which might trigger GC. Cheers --~--~-~--~~~---~--~~ 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: need some collection help
Here's what my code looks like... * private* Collection *_cars*; Car *myCar*= *new* Car(1,1,*false*,5, blue); Car *myCar2*= *new* Car(1,1,*false*,5, red); _cars.add(myCar); _cars.add(myCar2); On Thu, Mar 26, 2009 at 6:18 AM, Josh Dobbs joshdo...@gmail.com wrote: You mean like the ones in the java.util Yes, specifically java.util.collection What's a VO? A VO is basically a class that only contains properties(Value Objects). On Thu, Mar 26, 2009 at 4:53 AM, Mark Murphy mmur...@commonsware.comwrote: Josh wrote: I want to store objects into an array or collection(whichever is best suited to this in dalvik). You mean like the ones in the java.util package? the objects are basically just VO's all of the same class that i want to keep track of. What's a VO? -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ 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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to get the permission WRITE_SECURE_SETTINGS
Does any Android developer give me any explaination? I will appreciate any reply. Thanks Best Regards, Stanley On Mar 25, 6:37 pm, Stanley.lei xiaofeng.lei...@gmail.com wrote: One more thing as the supplement, is that I met this issue when I tried to call the non-published API BluetoothDevice.disable(), but the API BluetoothDevice.enable() works well. I am just curious about why enabling bluetooth is allowed, while disabling bluetooth is not allowed. I think these two API should have same security level. Of course, this is just my private opinion. Any mistake, please point it out. Thanks, Stanley On Mar 25, 6:17 pm, Stanley.lei xiaofeng.lei...@gmail.com wrote: Hi all, I am developing the application based on the latest cupcake branch. I met a security issue, which needs the permission WRITE_SECURE_SETTINGS. I have tried to grant it to my application, but when the package is installed, an error is reported: 01-15 06:50:49.780: WARN/PackageManager(160): Not granting permission android.permission.WRITE_SECURE_SETTINGS to package com.ourdroid.apks (protectionLevel=3 flags=0x44) I have searched in this group, and found some cases same as mime. My question is whether it is possible to get this permission? Any reply will be appreciated. Regards, Stanley --~--~-~--~~~---~--~~ 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: need some collection help
I don't understand what are you really asking? Whether arrays are faster than collection classes? Yes, they are faster, but you have to manage their contents (insertions, deletions, etc.) yourself. On Thu, Mar 26, 2009 at 3:31 PM, Josh Dobbs joshdo...@gmail.com wrote: Here's what my code looks like... private Collection _cars; Car myCar= new Car(1,1,false,5, blue); Car myCar2= new Car(1,1,false,5, red); _cars.add(myCar); _cars.add(myCar2); On Thu, Mar 26, 2009 at 6:18 AM, Josh Dobbs joshdo...@gmail.com wrote: You mean like the ones in the java.util Yes, specifically java.util.collection What's a VO? A VO is basically a class that only contains properties(Value Objects). On Thu, Mar 26, 2009 at 4:53 AM, Mark Murphy mmur...@commonsware.com wrote: Josh wrote: I want to store objects into an array or collection(whichever is best suited to this in dalvik). You mean like the ones in the java.util package? the objects are basically just VO's all of the same class that i want to keep track of. What's a VO? -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ 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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to get the permission WRITE_SECURE_SETTINGS
As far as I know this permissions won't be available to applications. My understanding is that there activities that your application will be able start that allow the user to change the settings in question. JBQ On Thu, Mar 26, 2009 at 6:31 AM, Stanley.lei xiaofeng.lei...@gmail.com wrote: Does any Android developer give me any explaination? I will appreciate any reply. Thanks Best Regards, Stanley On Mar 25, 6:37 pm, Stanley.lei xiaofeng.lei...@gmail.com wrote: One more thing as the supplement, is that I met this issue when I tried to call the non-published API BluetoothDevice.disable(), but the API BluetoothDevice.enable() works well. I am just curious about why enabling bluetooth is allowed, while disabling bluetooth is not allowed. I think these two API should have same security level. Of course, this is just my private opinion. Any mistake, please point it out. Thanks, Stanley On Mar 25, 6:17 pm, Stanley.lei xiaofeng.lei...@gmail.com wrote: Hi all, I am developing the application based on the latest cupcake branch. I met a security issue, which needs the permission WRITE_SECURE_SETTINGS. I have tried to grant it to my application, but when the package is installed, an error is reported: 01-15 06:50:49.780: WARN/PackageManager(160): Not granting permission android.permission.WRITE_SECURE_SETTINGS to package com.ourdroid.apks (protectionLevel=3 flags=0x44) I have searched in this group, and found some cases same as mime. My question is whether it is possible to get this permission? Any reply will be appreciated. Regards, Stanley -- Jean-Baptiste M. JBQ Queru Android Engineer, Google. Questions sent directly to me that have no reason for being private will likely get ignored or forwarded to a public forum with no further warning. --~--~-~--~~~---~--~~ 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] File size column in image database is always 0 for the newest image
Hi, I am uploading images to our webservice from the phone, and thus I need to know the exact size of an image. I noticed that with some photos from the G1, the webservice always failed, and found out that it's due to the file size always being 0 for the latest image in the database. Is this a known bug? What else can I do to find out the size of an image on the phone without going through the DB? I want to avoid writing the whole image to a byte buffer just to find out its size... here is some code to play with: ContentResolver contentResolver = getContentResolver (); Cursor c = contentResolver.query( Uri.parse(content://media/external/images/ media), new String[] { Images.ImageColumns._ID, Images.ImageColumns.DISPLAY_NAME, Images.ImageColumns.SIZE }, null, null, null); while (c.moveToNext()) { Log.d(PHOTO, c.getLong(0) + + c.getString(1) + + c.getLong(2)); } c.close(); This gives me 0 in the third column for the last entry (that's the newest photo). --~--~-~--~~~---~--~~ 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 OpenGL literature
If you're looking just for a book on OpenGL there are the official books: - The Redbook: The OpenGL Reference Manual http://www.opengl.org/documentation/blue_book/ - The Bluebook: The OpenGL Programming Guide http://www.opengl.org/documentation/red_book/ You can also look on this site: http://nehe.gamedev.net/ there is a OpenGL Tutorial but it is based on C/C++ programming language Lutz Am 25.03.2009 um 12:43 schrieb EvgenyV: Hi all, Can you please suggest some book(s) or any other useful references about OpenGL? Thanks in advance, Evgeny --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- smime.p7s Description: S/MIME cryptographic signature
[android-developers] Re: Providing text-to-speech (TTS) capability in my Android application?
If you need more languages, voices, I think a client/server solution would be better. Android app send a request (POST) to a TTS web server. The server sends back a mp3, or a html page with a link to a mp3. You download the mp3 on the SD card, and play it. The problem : finding a FREE TTS server online At least there a some free demo, you can start your dev. with them (ATT, vozme, VoiceForge...). And when you get some money : buy the server licence. --~--~-~--~~~---~--~~ 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: File size column in image database is always 0 for the newest image
I had the same problem and it was driving me nuts. I think it's a bug. Below is how i worked-around it. Do what you do now by calling insertImage(...). This will insert the image into the data-base; however, thumbnails are not correctly generated and the SIZE attribute is 0 (your problem that you see). Execute a query, and use the cursor to get the physical file-path (use the ImageColumns.DATA). Using the physical file-path, use the MediaScanner (MediaScannerConnection) to scan your newly inserted image. After the MediaScanner has finished, querying your image on ImageColumns.SIZE (and other attributes) should work correctly. I suggest to do this in a seperate worker-thread... it is kinda-slow. On Mar 26, 9:47 am, Matthias m.kaepp...@googlemail.com wrote: Hi, I am uploading images to our webservice from the phone, and thus I need to know the exact size of an image. I noticed that with some photos from the G1, the webservice always failed, and found out that it's due to the file size always being 0 for the latest image in the database. Is this a known bug? What else can I do to find out the size of an image on the phone without going through the DB? I want to avoid writing the whole image to a byte buffer just to find out its size... here is some code to play with: ContentResolver contentResolver = getContentResolver (); Cursor c = contentResolver.query( Uri.parse(content://media/external/images/ media), new String[] { Images.ImageColumns._ID, Images.ImageColumns.DISPLAY_NAME, Images.ImageColumns.SIZE }, null, null, null); while (c.moveToNext()) { Log.d(PHOTO, c.getLong(0) + + c.getString(1) + + c.getLong(2)); } c.close(); This gives me 0 in the third column for the last entry (that's the newest photo). --~--~-~--~~~---~--~~ 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: Anything on Android that can do smooth scrolling?
Add my vote for this option/feature: A permission for an app to become the only app running (except maybe the phone-app and incoming SMS, etc). On Mar 26, 7:26 am, Stoyan Damov stoyan.da...@gmail.com wrote: I've also proposed a solution to this - adding a permission for apps to request that they run alone, uninterrupted by other processes. That is, the app can request a permission, demanding that the app can only be interrupted by an external event, such as phone call, all other services and background processes (other than the ones the OS can't go without) are paused when app is running. I know it's quite tricky to implement this, because, for example, when an SMS is received it needs to be stored in the database, and this will require some memory, which will need to be discarded, when the SMS is written to the database, and this will trigger GC. However, when such a message is received, and the OS knows that an app with the special permission runs in the foreground, it could delay the GC either until: - the app itself allocates memory (no matter if it might not be actually GC'ed until the app finishes) OR - the systems goes pretty low on memory At least, non-stock services (i.e. services, developed by 3rd parties) can be suspended during the lifetime of an application requesting the special permission. Cheers On Thu, Mar 26, 2009 at 11:51 AM, Stoyan Damov stoyan.da...@gmail.com wrote: On Wed, Mar 25, 2009 at 11:02 PM, Romain Guy romain...@google.com wrote: The trick is simple: avoid any allocation that might trigger a GC. It's not that simple at all. In fact, it is *impossible* on Android, or any other mobile OS which allows background processes. I've already said this once -- even though your game can be tuned to the max, nothing prevents *other* apps from triggering GC. That is, in my game, I *never*, *ever* do any allocation after startup. However, other background processes do trigger GC, and voila - my game stutters for a bit when GC kicks in. Compare to iPhone, which disallows background processing and the foreground app is never interrupted. Cheers- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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: Http GET method with extra headers
Hi, try the 'setHeader(String name, String value)' method from the HttpGet class. For example: --- snip --- DefaultHttpClient client = new DefaultHttpClient(); HttpGet method = new HttpGet(url); HttpResponse response = null; method.setHeader(user-agent, getText(R.string.app_name).toString()); try { response = client.execute(method); } catch(IOException e) { e.printStackTrace(); } --- snip --- Using setHeader replaces the first header with the same name or if not found it will be added. Lutz Am 26.03.2009 um 13:23 schrieb zeeshan: Hi Experts, i am trying a GET request to my server with some extra headers dont know how can i add header here is my code: DefaultHttpClient client = new DefaultHttpClient(); HttpGet method = null; HttpResponse resp = null; method = new HttpGet( new URI(url) ); } catch (Exception e) { e.printStackTrace(); } try { resp = client.execute(method); } catch (IOException e) { e.printStackTrace(); } /// i can add header like below but this shows me POST HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection(); String boundary = myboundary; httpConnection.setDoOutput(true); httpConnection.setDoInput(true); httpConnection.setUseCaches(false); //httpConnection.setRequestMethod(GET); httpConnection.setRequestProperty(Connection,Keep- Alive); httpConnection.setRequestProperty(Content-Type,multipart/form- data; boundary= + boundary); httpConnection.setRequestProperty(user-agent,this.user_agent); httpConnection.setRequestProperty(accept- language,this.accept_language); httpConnection.setRequestProperty(user-agent- id,this.user_agent_id); httpConnection.setAllowUserInteraction(true); httpConnection.setInstanceFollowRedirects(true); //httpConnection.connect(); DataOutputStream wr = new DataOutputStream (httpConnection.getOutputStream()); any solution to add header in GET? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- smime.p7s Description: S/MIME cryptographic signature
[android-developers] Re: Anything on Android that can do smooth scrolling?
There are some problems with that approach: -it's an arms race. You've already identified the need for certain apps to continue running even when there's an exclusive app running, which'd have to be protected by a permission. Either that permission is system-only and we move further away from the goal of having all applications equal, and it's accessible to all applications and it's only a matter of time before all applications have it, which makes the entire exercise pointless (put yourselves in the shoes of the developer of an app with background components - from their point of view, their app is obviously the most important app, and they don't want anyone to be able to tell them that their app isn't allowed to run). -the granularity that you really want is not that of an application - preventing other applications from running will prevent their services and providers from running even if they are necessary to run the front application. -even if you could do that, it would only be a partial solution at best, as system_server itself will probably still do a few allocations, and binder transactions eventually cause GCs as well. FWIW, this would be an excellent discussion for the android-framework group, where we discuss how changes in the android platform impact SDK-level application development. JBQ On Thu, Mar 26, 2009 at 6:58 AM, Streets Of Boston flyingdutc...@gmail.com wrote: Add my vote for this option/feature: A permission for an app to become the only app running (except maybe the phone-app and incoming SMS, etc). On Mar 26, 7:26 am, Stoyan Damov stoyan.da...@gmail.com wrote: I've also proposed a solution to this - adding a permission for apps to request that they run alone, uninterrupted by other processes. That is, the app can request a permission, demanding that the app can only be interrupted by an external event, such as phone call, all other services and background processes (other than the ones the OS can't go without) are paused when app is running. I know it's quite tricky to implement this, because, for example, when an SMS is received it needs to be stored in the database, and this will require some memory, which will need to be discarded, when the SMS is written to the database, and this will trigger GC. However, when such a message is received, and the OS knows that an app with the special permission runs in the foreground, it could delay the GC either until: - the app itself allocates memory (no matter if it might not be actually GC'ed until the app finishes) OR - the systems goes pretty low on memory At least, non-stock services (i.e. services, developed by 3rd parties) can be suspended during the lifetime of an application requesting the special permission. Cheers On Thu, Mar 26, 2009 at 11:51 AM, Stoyan Damov stoyan.da...@gmail.com wrote: On Wed, Mar 25, 2009 at 11:02 PM, Romain Guy romain...@google.com wrote: The trick is simple: avoid any allocation that might trigger a GC. It's not that simple at all. In fact, it is *impossible* on Android, or any other mobile OS which allows background processes. I've already said this once -- even though your game can be tuned to the max, nothing prevents *other* apps from triggering GC. That is, in my game, I *never*, *ever* do any allocation after startup. However, other background processes do trigger GC, and voila - my game stutters for a bit when GC kicks in. Compare to iPhone, which disallows background processing and the foreground app is never interrupted. Cheers- Hide quoted text - - Show quoted text - -- Jean-Baptiste M. JBQ Queru Android Engineer, Google. Questions sent directly to me that have no reason for being private will likely get ignored or forwarded to a public forum with no further warning. --~--~-~--~~~---~--~~ 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: Http GET method with extra headers
Why getText(...).toString() rather than getString(...)? Neil On Mar 26, 3:08 pm, Lutz Schönemann lutz.schoenem...@sit.fraunhofer.de wrote: Hi, try the 'setHeader(String name, String value)' method from the HttpGet class. For example: --- snip --- DefaultHttpClient client = new DefaultHttpClient(); HttpGet method = new HttpGet(url); HttpResponse response = null; method.setHeader(user-agent, getText(R.string.app_name).toString()); try { response = client.execute(method);} catch(IOException e) { e.printStackTrace(); } --- snip --- Using setHeader replaces the first header with the same name or if not found it will be added. Lutz Am 26.03.2009 um 13:23 schrieb zeeshan: Hi Experts, i am trying a GET request to my server with some extra headers dont know how can i add header here is my code: DefaultHttpClient client = new DefaultHttpClient(); HttpGet method = null; HttpResponse resp = null; method = new HttpGet( new URI(url) ); } catch (Exception e) { e.printStackTrace(); } try { resp = client.execute(method); } catch (IOException e) { e.printStackTrace(); } /// i can add header like below but this shows me POST HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection(); String boundary = myboundary; httpConnection.setDoOutput(true); httpConnection.setDoInput(true); httpConnection.setUseCaches(false); //httpConnection.setRequestMethod(GET); httpConnection.setRequestProperty(Connection,Keep- Alive); httpConnection.setRequestProperty(Content-Type,multipart/form- data; boundary= + boundary); httpConnection.setRequestProperty(user-agent,this.user_agent); httpConnection.setRequestProperty(accept- language,this.accept_language); httpConnection.setRequestProperty(user-agent- id,this.user_agent_id); httpConnection.setAllowUserInteraction(true); httpConnection.setInstanceFollowRedirects(true); //httpConnection.connect(); DataOutputStream wr = new DataOutputStream (httpConnection.getOutputStream()); any solution to add header in GET? smime.p7s 10KViewDownload --~--~-~--~~~---~--~~ 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: Anything on Android that can do smooth scrolling?
On Thu, Mar 26, 2009 at 4:14 PM, Jean-Baptiste Queru j...@android.com wrote: There are some problems with that approach: -it's an arms race. You've already identified the need for certain apps to continue running even when there's an exclusive app running, which'd have to be protected by a permission. Either that permission is system-only and we move further away from the goal of having all applications equal, and it's accessible to all applications and it's only a matter of time before all applications have it, which makes the entire exercise pointless (put yourselves in the shoes of the developer of an app with background components - from their point of view, their app is obviously the most important app, and they don't want anyone to be able to tell them that their app isn't allowed to run). Screw the developer. I'll put myself in the shoes of the user. I have launched myself a game. I want it to run at full speed. I could care less that a background service, polling RSS feeds have just found out that someone posted a new blog entry. I'm sure you now understand there's no issue with background apps and which is more important. -the granularity that you really want is not that of an application - preventing other applications from running will prevent their services and providers from running even if they are necessary to run the front application. Now, I realize that this permission should not be that simple - it should allow the apps to specify which components are OK to run (system components will always run, of course). For example, the RSS reader application will want to run itself, and this or that service it depends on. I don't see how this would be a problem. The permission should simply allow one or more components to be listed as dependencies. -even if you could do that, it would only be a partial solution at best, as system_server itself will probably still do a few allocations, and binder transactions eventually cause GCs as well. Processes, which absolutely need to run (performing or not GCs) is OK to run. Think about it - the experience will in *any* case be greater, than it is now. FWIW, this would be an excellent discussion for the android-framework group, where we discuss how changes in the android platform impact SDK-level application development. I agree, but since this originated from a android-developers post I thought it's OK to discuss here. Will move the discussion there this weekend, when I have the time to think about this feature a bit more. Cheers JBQ On Thu, Mar 26, 2009 at 6:58 AM, Streets Of Boston flyingdutc...@gmail.com wrote: Add my vote for this option/feature: A permission for an app to become the only app running (except maybe the phone-app and incoming SMS, etc). On Mar 26, 7:26 am, Stoyan Damov stoyan.da...@gmail.com wrote: I've also proposed a solution to this - adding a permission for apps to request that they run alone, uninterrupted by other processes. That is, the app can request a permission, demanding that the app can only be interrupted by an external event, such as phone call, all other services and background processes (other than the ones the OS can't go without) are paused when app is running. I know it's quite tricky to implement this, because, for example, when an SMS is received it needs to be stored in the database, and this will require some memory, which will need to be discarded, when the SMS is written to the database, and this will trigger GC. However, when such a message is received, and the OS knows that an app with the special permission runs in the foreground, it could delay the GC either until: - the app itself allocates memory (no matter if it might not be actually GC'ed until the app finishes) OR - the systems goes pretty low on memory At least, non-stock services (i.e. services, developed by 3rd parties) can be suspended during the lifetime of an application requesting the special permission. Cheers On Thu, Mar 26, 2009 at 11:51 AM, Stoyan Damov stoyan.da...@gmail.com wrote: On Wed, Mar 25, 2009 at 11:02 PM, Romain Guy romain...@google.com wrote: The trick is simple: avoid any allocation that might trigger a GC. It's not that simple at all. In fact, it is *impossible* on Android, or any other mobile OS which allows background processes. I've already said this once -- even though your game can be tuned to the max, nothing prevents *other* apps from triggering GC. That is, in my game, I *never*, *ever* do any allocation after startup. However, other background processes do trigger GC, and voila - my game stutters for a bit when GC kicks in. Compare to iPhone, which disallows background processing and the foreground app is never interrupted. Cheers- Hide quoted text - - Show quoted text - -- Jean-Baptiste M. JBQ Queru Android Engineer, Google. Questions sent directly to me that have no reason for being private will
[android-developers] Re: File size column in image database is always 0 for the newest image
Hi, thanks for the swift reply! Hm, if the workaround you suggest is slow, maybe I am better off with writing the image to a byte buffer and taking its size after all? I just tested that solution, and it was much faster than I expected. Since I upload images in a background service, it may not even be a noticeable overhead to the user. But still, this is an annoyance, did you already raise a bug for this? Cheers, Matthias --~--~-~--~~~---~--~~ 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] API reference for system application
Hi, I want to do some development on the Android system. Is there a way to make Eclipse know about the entire API that Android provides to systemtools? And is there a reference for that API? Thanks Lutz smime.p7s Description: S/MIME cryptographic signature
[android-developers] How to extend GMail App
hi, is it possible to put my own function (as a button per Attachment) in the Gmail app? If yes: how can I achieve that? Are there tutorials? Thank you. --~--~-~--~~~---~--~~ 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: HttpGet.addHeader
thanks for the reply, it is solved actually i was adding header before it get initialised it should be like this method = new HttpGet( new URI(url) ); method.addHeader(Connection,Keep-Alive); i suppose to get an xml on this request , how can i make input stream? do i need to connect it again like below HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection(); InputStream in = httpConnection.getInputStream(); On Mar 26, 1:15 pm, Stoyan Damov stoyan.da...@gmail.com wrote: What happens if you do this instead: method.getParams().setParameter(http.useragent, this.user_agent_id); ? On Thu, Mar 26, 2009 at 2:54 PM, zeeshan genx...@gmail.com wrote: Hi Experts, i am trying to add header on HttpGet but it raise this exception InvocationTargetException here is my code: DefaultHttpClient client = new DefaultHttpClient(); HttpGet method = null; HttpResponse resp = null; String url = http://www.x.com/a.xml;; method.addHeader(Connection,Keep-Alive); /*method.addHeader(accept-language,this.accept_language); method.addHeader(user-agent-id,this.user_agent_id);*/ method = new HttpGet( new URI(url) ); i also used setHeader but same error please help me out --~--~-~--~~~---~--~~ 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: HttpGet.addHeader
thanks for reply, it is working now, i was tring to add header before it get initialised it should be lilke that method = new HttpGet( new URI(url) ); method.addHeader(Connection,Keep-Alive); On Mar 26, 1:15 pm, Stoyan Damov stoyan.da...@gmail.com wrote: What happens if you do this instead: method.getParams().setParameter(http.useragent, this.user_agent_id); ? On Thu, Mar 26, 2009 at 2:54 PM, zeeshan genx...@gmail.com wrote: Hi Experts, i am trying to add header on HttpGet but it raise this exception InvocationTargetException here is my code: DefaultHttpClient client = new DefaultHttpClient(); HttpGet method = null; HttpResponse resp = null; String url = http://www.x.com/a.xml;; method.addHeader(Connection,Keep-Alive); /*method.addHeader(accept-language,this.accept_language); method.addHeader(user-agent-id,this.user_agent_id);*/ method = new HttpGet( new URI(url) ); i also used setHeader but same error please help me out --~--~-~--~~~---~--~~ 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: Building user interfaces at runtime with layouts from server
I chose the do it yourself approach and parse the layout.xml by myself. The simple part (reading the element names and building the widget tree) works quite well. Then I wrote an own implementation of android.util.AttributeSet which wraps a org.w3c.dom.NamedNodeMap. When I try to instantiate a View class with my own AttributeSet implementation I get hit by a ClassCastException. After a short investigation I found the following code. When can I expect this to be fixed? android.content.res.Resources.Theme public TypedArray obtainStyledAttributes(AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes) { int len = attrs.length; TypedArray array = getCachedStyledAttributes(len); // XXX note that for now we only work with compiled XML files. // To support generic XML files we will need to manually parse // out the attributes from the XML file (applying type information // contained in the resources and such). XmlBlock.Parser parser = (XmlBlock.Parser)set; --- NOT GOOD FOR MY OWN AttributeSet implementation AssetManager.applyStyle( mTheme, defStyleAttr, defStyleRes, parser != null ? parser.mParseState : 0, attrs, array.mData, array.mIndices); array.mRsrcs = attrs; On Mar 24, 2:59 pm, Daniel daniel.kro...@gmail.com wrote: Thanks for your response. My use case is as follows: We have a server application which allows to be extended by plugins. Each plugin contributes a view and some logic. Until now, the only client we support is a web client. Every plugin contributes a jsf based xhtml page plus some java beans. What we want to do now is to support a native android client. A part of its user interface should be fixed, another part should be provided by the mentioned plugins. By adding a new plugin on the server, the user should be able use the new functionality immediately. To make that working, a plugin needs to provide a kind of an android user interface description. And of course, the android client needs to be able to render this user interface description, register generic listeners on the given ui and handle events appropriately (by sending a response to a web service for instance). The point is now: Android already has this user interface description (layout.xml) and the code which inflates such a description (in preprocessed form) to a user interface. It would be awesome to reuse this code! Thanks.Daniel On Mar 23, 6:25 pm, droozen droozenr...@gmail.com wrote: We might have to know why you want to build this way. There could be other possibilities, including using a much simpler xml that you could parse yourself and add UI elements programmatically. Or have a variety of layouts available that you could set, depending on a value you've downloaded, though I get the feeling you want something more dynamic than that. On Mar 23, 2:10 am,Danieldaniel.kro...@gmail.com wrote: Hi all, Q: What is the recommended way to build user interfaces on the device based on layouts provided by a server at runtime? I am aware of this: snip source=http://developer.android.com/reference/android/view/ LayoutInflater.html For performance reasons, view inflation relies heavily on pre- processing of XML files that is done at build time. Therefore, it is not currently possible to use LayoutInflater with an XmlPullParser over a plain XML file at runtime; it only works with an XmlPullParser returned from a compiled resource (R.something file.) /snip I could imagine these possibilities: - Parse XML by myself and build the ui tree. (Seems inappropriate to me since there is already maintained code which is able to do this.) - Transform XML on server to a simpler format which is cheaper to parse on the device. (Inappropriate as above.) - Preprocess the XML layout on the server the same way the build does. Transmit it to the client, and then try to load it. But how? android.content.res.XMLBlock is hidden (@hide) and I don't know how to classify the stuff in package com.android.layoutlib.bridge. Any help would be appreciated. Daniel --~--~-~--~~~---~--~~ 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: HttpGet.addHeader
If you use the DefaultHttpClient to connect to your server you don't need to reconnect. You'll receive a HttpResponse. You should validate the status code if the request was successful. after that just retrieve the HttpEntity. This class provides a getContent() method which returns a InputStream: --- snip --- HttpResponse response = null; InputStream in = null; try { client.execute(method); } catch(Exception e) { // handle exception } if(response.getStatusLine().getStatusCode() == 200) { HttpEntity entity = response.getEntity(); if(entity != null) { try { in = entity.getContent(); } catch(IOException e) { // handle exception } } } if(in != null) { // use in to read body of http response } --- snip --- Maybe there is a better way to get the body from the response but I don't know it... Lutz Am 26.03.2009 um 15:43 schrieb zeeshan: thanks for the reply, it is solved actually i was adding header before it get initialised it should be like this method = new HttpGet( new URI(url) ); method.addHeader(Connection,Keep-Alive); i suppose to get an xml on this request , how can i make input stream? do i need to connect it again like below HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection(); InputStream in = httpConnection.getInputStream(); On Mar 26, 1:15 pm, Stoyan Damov stoyan.da...@gmail.com wrote: What happens if you do this instead: method.getParams().setParameter(http.useragent, this.user_agent_id); ? On Thu, Mar 26, 2009 at 2:54 PM, zeeshan genx...@gmail.com wrote: Hi Experts, i am trying to add header on HttpGet but it raise this exception InvocationTargetException here is my code: DefaultHttpClient client = new DefaultHttpClient(); HttpGet method = null; HttpResponse resp = null; String url = http://www.x.com/a.xml;; method.addHeader(Connection,Keep-Alive); /*method.addHeader(accept-language,this.accept_language); method.addHeader(user-agent-id,this.user_agent_id);*/ method = new HttpGet( new URI(url) ); i also used setHeader but same error please help me out --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- smime.p7s Description: S/MIME cryptographic signature
[android-developers] Re: File size column in image database is always 0 for the newest image
You still may need to do this, though. With my application; if i don't do the MediaScanner thing, the 'Pictures' application will crash! You may find the same problem. Try to insert an image (with the SIZE being 0), then close your app and start the stock 'Pictures' application. Check if it crashes or not. If it does, you should do the MediaScanner thing. You don't want to get angry customers :-) On Mar 26, 10:32 am, matthias m.kaepp...@googlemail.com wrote: Hi, thanks for the swift reply! Hm, if the workaround you suggest is slow, maybe I am better off with writing the image to a byte buffer and taking its size after all? I just tested that solution, and it was much faster than I expected. Since I upload images in a background service, it may not even be a noticeable overhead to the user. But still, this is an annoyance, did you already raise a bug for this? Cheers, Matthias --~--~-~--~~~---~--~~ 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: Building user interfaces at runtime with layouts from server
I chose the do it yourself approach and parse the layout.xml by myself. The simple part (reading the element names and building the widget tree) works quite well. Then I wrote an own implementation of android.util.AttributeSet which wraps a org.w3c.dom.NamedNodeMap. When I try to instantiate a View class with my own AttributeSet implementation I get hit by a ClassCastException. After a short investigation I found the following code. When can I expect this to be fixed? Sometime after it is listed as an issue on http://b.android.com, and then sometime after somebody with the itch elects to scratch it and submit a patch to http://source.android.com. That could be somebody on the core Android team, but it does not have to be. Considering how many outstanding feature requests there are, you will probably get a faster response if you can submit a patch yourself or directly engage with somebody who can submit a patch for you. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ 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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: HttpGet.addHeader
ResponseHandlerString responseHandler = new BasicResponseHandler(); String body = httpClient.execute(method, responseHandler); 2009/3/26 Lutz Schönemann lutz.schoenem...@sit.fraunhofer.de: If you use the DefaultHttpClient to connect to your server you don't need to reconnect. You'll receive a HttpResponse. You should validate the status code if the request was successful. after that just retrieve the HttpEntity. This class provides a getContent() method which returns a InputStream: --- snip --- HttpResponse response = null; InputStream in = null; try { client.execute(method); } catch(Exception e) { // handle exception } if(response.getStatusLine().getStatusCode() == 200) { HttpEntity entity = response.getEntity(); if(entity != null) { try { in = entity.getContent(); } catch(IOException e) { // handle exception } } } if(in != null) { // use in to read body of http response } --- snip --- Maybe there is a better way to get the body from the response but I don't know it... Lutz Am 26.03.2009 um 15:43 schrieb zeeshan: thanks for the reply, it is solved actually i was adding header before it get initialised it should be like this method = new HttpGet( new URI(url) ); method.addHeader(Connection,Keep-Alive); i suppose to get an xml on this request , how can i make input stream? do i need to connect it again like below HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection(); InputStream in = httpConnection.getInputStream(); On Mar 26, 1:15 pm, Stoyan Damov stoyan.da...@gmail.com wrote: What happens if you do this instead: method.getParams().setParameter(http.useragent, this.user_agent_id); ? On Thu, Mar 26, 2009 at 2:54 PM, zeeshan genx...@gmail.com wrote: Hi Experts, i am trying to add header on HttpGet but it raise this exception InvocationTargetException here is my code: DefaultHttpClient client = new DefaultHttpClient(); HttpGet method = null; HttpResponse resp = null; String url = http://www.x.com/a.xml;; method.addHeader(Connection,Keep-Alive); /*method.addHeader(accept-language,this.accept_language); method.addHeader(user-agent-id,this.user_agent_id);*/ method = new HttpGet( new URI(url) ); i also used setHeader but same error please help me out --~--~-~--~~~---~--~~ 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: kill GPS activity when quitting an application
I only need one location... so I only want to get one fix. However this is indeed a problem because I never know how many calls I have to make before to get an accurate reading... On 25 mrt, 13:14, ellipsoidmob...@googlemail.com ellipsoidmob...@googlemail.com wrote: When you 'exit' an application, it isn't necessarily immediately destroyed by the system (see the activity lifecycle documentation), so I suspect that's why the GPS stays active and keeps getting updates. You might want to remove updates in onStop() instead. Probably unrelated, but calling onDestroy from onLocationChanged looks a bit odd? Looks like you will only ever get one update? --~--~-~--~~~---~--~~ 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: Anything on Android that can do smooth scrolling?
On Thu, Mar 26, 2009 at 7:25 AM, Stoyan Damov stoyan.da...@gmail.com wrote: Screw the developer. I'll put myself in the shoes of the user. I have launched myself a game. I want it to run at full speed. I could care less that a background service, polling RSS feeds have just found out that someone posted a new blog entry. I'm sure you now understand there's no issue with background apps and which is more important. You've just put yourself deeper in a position where you see your application as the most important one. Well, in the shoes of the user, you now have an application (your game) that hurts the entire system. When your app is running, the user doesn't receive their email any more, they don't get updates from twitter, latitude doesn't work... and there will probably be lots of other cases. If we go down that path, 6 months from now we'll have requests for a permission that allows background apps to say I don't want apps to run in the foreground that prevent background apps from running, and their request will be just as reasonable as yours: their app doesn't coexist with yours, so they want to prevent yours from running (just like you want to prevent theirs from running). Now, I realize that this permission should not be that simple - it should allow the apps to specify which components are OK to run (system components will always run, of course). For example, the RSS reader application will want to run itself, and this or that service it depends on. I don't see how this would be a problem. The permission should simply allow one or more components to be listed as dependencies. It's not as simple as it seems, as you're putting a requirement on background applications to identify which components they (transitively) rely on in order to work properly. Imagine that your app relies on component A, but that (as an implementation detail) component A relies on component B: now you need component A to identify that it needs component B, so that component B can also be made immune to the kill-by-game behavior. I think that we've gone way too far from the original problem. The original problem as I see it isn't about GCs in other apps, it's about behaviors that cause remote GCs in your game. I think it'd be much simpler if your game could say I don't want remote asynchronous GCs, and it would probably even be more effective. It might turn out to also be more acceptable design-wise, and easier to implement in the framework. Better still, since it's a same-process behavior, there's not even a need to put permissions around it, since from the point of view of the permission system an app is free to do whatever it wants in its processes. --~--~-~--~~~---~--~~ 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: App localization
I understand that it works like that in the emulator but I read somewhere that it works differently on a real device. glad that it's so simple. Thanks. On Mar 24, 4:46 pm, Bernhard Fuhry bernhard.fu...@gmail.com wrote: I have the english translation in the values folder (values/ strings.xml) and the german version in a seperate folder (values-de/ strings.xml) and it works well that way. general strings that are the same for both languages can be kept in the values/strings.xml and don't need to be copied over to each and every translation (like version, app name, etc.) Yossi wrote: Hi, I'm planning to localize my app (e.g. translate to different languages). Assuming it will support English and German, does it mean that users in Germany will get only the German text or would they be able to choose having it in English? Thanks, Yossi --~--~-~--~~~---~--~~ 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: File size column in image database is always 0 for the newest image
Hi, On Mar 26, 4:04 pm, Streets Of Boston flyingdutc...@gmail.com wrote: You still may need to do this, though. With my application; if i don't do the MediaScanner thing, the 'Pictures' application will crash! You may find the same problem. Try to insert an image (with the SIZE being 0), then close your app and start the stock 'Pictures' application. Check if it crashes or not. If it does, you should do the MediaScanner thing. You don't want to get angry customers :-) I see. I do not insert images into the database myself though. I only load them; but if the user takes a picture and then wants to select it from the gallery app, then its size is also 0, that's why I was having these problems. --~--~-~--~~~---~--~~ 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: Anything on Android that can do smooth scrolling?
On Thu, Mar 26, 2009 at 5:24 PM, Jean-Baptiste Queru j...@android.com wrote: On Thu, Mar 26, 2009 at 7:25 AM, Stoyan Damov stoyan.da...@gmail.com wrote: Screw the developer. I'll put myself in the shoes of the user. I have launched myself a game. I want it to run at full speed. I could care less that a background service, polling RSS feeds have just found out that someone posted a new blog entry. I'm sure you now understand there's no issue with background apps and which is more important. You've just put yourself deeper in a position where you see your application as the most important one. Well, in the shoes of the user, you now have an application (your game) that hurts the entire system. When your app is running, the user doesn't receive their email any more, they don't get updates from twitter, latitude doesn't work... and there will probably be lots of other cases. You have clearly misunderstood what I said. I said I'll put myself in the shoes of the user. By I have launched myself a game. I meant, that I am the user, and want to launch a game, and so I do. That is, I am the user, I want to launch a game, and I don't give a ... what other apps are running in the background. I don't want to see what others are twitting, I don't care what e-mails I might have received, and I don't give a about nothing. I am in the loo for 10 minutes, and I'm launching a game, I want to play the game, and I don't care about anything. It's my 10 private minutes in the loo, and I could care less of *anything* else. I don't care how much the system is hurt, I want ot play for crying out loud, and I want to play at full speed with the best quality possible. Do you now understand what I said? If we go down that path, 6 months from now we'll have requests for a permission that allows background apps to say I don't want apps to run in the foreground that prevent background apps from running, and their request will be just as reasonable as yours: their app doesn't coexist with yours, so they want to prevent yours from running (just like you want to prevent theirs from running). You are only strengthening my opinion that you have completely misunderstood what I said. It is all for the benefit of the USER, THE USER, not the developer, not the OS, not Google. If the user wants these services to run, he won't be playing the game, and hey, you could do an *even better* job *denying* the application this restriction, and running it as usual. Or give the user the ability to turn on and off this permission to any application at any time while the app is not running!!! Are you thinking that the iPhone is a failure because it doesn't allow background processing? Now, I realize that this permission should not be that simple - it should allow the apps to specify which components are OK to run (system components will always run, of course). For example, the RSS reader application will want to run itself, and this or that service it depends on. I don't see how this would be a problem. The permission should simply allow one or more components to be listed as dependencies. It's not as simple as it seems, as you're putting a requirement on background applications to identify which components they (transitively) rely on in order to work properly. Imagine that your app relies on component A, but that (as an implementation detail) component A relies on component B: now you need component A to identify that it needs component B, so that component B can also be made immune to the kill-by-game behavior. Actually I don't need to specify anything. I just proposed that. I now realize you can do it automatically. The second an app marked with the special permission binds to a service or accesses a content provider, it is more than obvious that the service, is indeed needed by the application and should be allowed to run. I think that we've gone way too far from the original problem. The original problem as I see it isn't about GCs in other apps, it's about behaviors that cause remote GCs in your game. I think it'd be much simpler if your game could say I don't want remote asynchronous GCs, and it would probably even be more effective. I absolutely agree. This is another, different, but unarguably BETTER solution to the problem. Do it!!! :) It might turn out to also be more acceptable design-wise, and easier to implement in the framework. Better still, since it's a same-process behavior, there's not even a need to put permissions around it, since from the point of view of the permission system an app is free to do whatever it wants in its processes. Great! Do it!!! :) Cheers --~--~-~--~~~---~--~~ 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] Re: Building user interfaces at runtime with layouts from server
The point is now: Android already has this user interface description (layout.xml) and the code which inflates such a description (in preprocessed form) to a user interface. It would be awesome to reuse this code! You can use that LayoutInflater to create the tree of views and attach it to your Activity. I found some code inside the PackageInstaller to load the layout from the resources but you can also use an 'external' xml. --- snip --- View contentView; XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); XmlPullParser xpp = factory.newPullParser(); xpp.setInput(new FileReader(/path/to/layout.xml)); LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); contentView = inflater.inflate(xpp, null); setContentView(contentView); --- snip --- This code isn't tested!!! That's only the way I think it should work. Lutz Thanks. Daniel On Mar 23, 6:25 pm, droozen droozenr...@gmail.com wrote: We might have to know why you want to build this way. There could be other possibilities, including using a much simpler xml that you could parse yourself and add UI elements programmatically. Or have a variety of layouts available that you could set, depending on a value you've downloaded, though I get the feeling you want something more dynamic than that. On Mar 23, 2:10 am,Danieldaniel.kro...@gmail.com wrote: Hi all, Q: What is the recommended way to build user interfaces on the device based on layouts provided by a server at runtime? I am aware of this: snip source=http://developer.android.com/reference/android/view/ LayoutInflater.html For performance reasons, view inflation relies heavily on pre- processing of XML files that is done at build time. Therefore, it is not currently possible to use LayoutInflater with an XmlPullParser over a plain XML file at runtime; it only works with an XmlPullParser returned from a compiled resource (R.something file.) /snip I could imagine these possibilities: - Parse XML by myself and build the ui tree. (Seems inappropriate to me since there is already maintained code which is able to do this.) - Transform XML on server to a simpler format which is cheaper to parse on the device. (Inappropriate as above.) - Preprocess the XML layout on the server the same way the build does. Transmit it to the client, and then try to load it. But how? android.content.res.XMLBlock is hidden (@hide) and I don't know how to classify the stuff in package com.android.layoutlib.bridge. Any help would be appreciated. Daniel --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- smime.p7s Description: S/MIME cryptographic signature
[android-developers] Re: HttpGet.addHeader
Am 26.03.2009 um 16:12 schrieb Stoyan Damov: ResponseHandlerString responseHandler = new BasicResponseHandler(); String body = httpClient.execute(method, responseHandler); That's much simpler. But is there a way to get the status code if you do it this way? Lutz 2009/3/26 Lutz Schönemann lutz.schoenem...@sit.fraunhofer.de: If you use the DefaultHttpClient to connect to your server you don't need to reconnect. You'll receive a HttpResponse. You should validate the status code if the request was successful. after that just retrieve the HttpEntity. This class provides a getContent() method which returns a InputStream: --- snip --- HttpResponse response = null; InputStream in = null; try { client.execute(method); } catch(Exception e) { // handle exception } if(response.getStatusLine().getStatusCode() == 200) { HttpEntity entity = response.getEntity(); if(entity != null) { try { in = entity.getContent(); } catch(IOException e) { // handle exception } } } if(in != null) { // use in to read body of http response } --- snip --- Maybe there is a better way to get the body from the response but I don't know it... Lutz Am 26.03.2009 um 15:43 schrieb zeeshan: thanks for the reply, it is solved actually i was adding header before it get initialised it should be like this method = new HttpGet( new URI(url) ); method.addHeader(Connection,Keep-Alive); i suppose to get an xml on this request , how can i make input stream? do i need to connect it again like below HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection(); InputStream in = httpConnection.getInputStream(); On Mar 26, 1:15 pm, Stoyan Damov stoyan.da...@gmail.com wrote: What happens if you do this instead: method.getParams().setParameter(http.useragent, this.user_agent_id); ? On Thu, Mar 26, 2009 at 2:54 PM, zeeshan genx...@gmail.com wrote: Hi Experts, i am trying to add header on HttpGet but it raise this exception InvocationTargetException here is my code: DefaultHttpClient client = new DefaultHttpClient(); HttpGet method = null; HttpResponse resp = null; String url = http://www.x.com/a.xml;; method.addHeader(Connection,Keep-Alive); /*method.addHeader(accept-language,this.accept_language); method.addHeader(user-agent-id,this.user_agent_id);*/ method = new HttpGet( new URI(url) ); i also used setHeader but same error please help me out --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~--- smime.p7s Description: S/MIME cryptographic signature
[android-developers] Re: Anything on Android that can do smooth scrolling?
On Thu, Mar 26, 2009 at 5:40 PM, Stoyan Damov stoyan.da...@gmail.com wrote: On Thu, Mar 26, 2009 at 5:24 PM, Jean-Baptiste Queru j...@android.com wrote: I think that we've gone way too far from the original problem. The original problem as I see it isn't about GCs in other apps, it's about behaviors that cause remote GCs in your game. I think it'd be much simpler if your game could say I don't want remote asynchronous GCs, and it would probably even be more effective. JBQ, btw, how is it possible for other apps to trigger GC in my process? Is Android so aggressive about launching as few processes as possible, that it won't run my app in a new process, even if the # of running proceses is low? 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: Anything on Android that can do smooth scrolling?
Got to say I'd prefer a good user experience to developer orientated features any day. All apps can be still be created equal, all that needs to happen is alongside the exclusive running permission there is an interrupt everything permission that allows an intent to pause an exclusive running app to interact with the user (e.g. message arrived popup, etc). The exclusive app can use the onPause and onStart part of it's lifecycle to handle the interruption. Al. -Original Message- From: android-developers@googlegroups.com [mailto:android-develop...@googlegroups.com] On Behalf Of Stoyan Damov Sent: 26 March 2009 15:40 To: android-developers@googlegroups.com Subject: [android-developers] Re: Anything on Android that can do smooth scrolling? On Thu, Mar 26, 2009 at 5:24 PM, Jean-Baptiste Queru j...@android.com wrote: On Thu, Mar 26, 2009 at 7:25 AM, Stoyan Damov stoyan.da...@gmail.com wrote: Screw the developer. I'll put myself in the shoes of the user. I have launched myself a game. I want it to run at full speed. I could care less that a background service, polling RSS feeds have just found out that someone posted a new blog entry. I'm sure you now understand there's no issue with background apps and which is more important. You've just put yourself deeper in a position where you see your application as the most important one. Well, in the shoes of the user, you now have an application (your game) that hurts the entire system. When your app is running, the user doesn't receive their email any more, they don't get updates from twitter, latitude doesn't work... and there will probably be lots of other cases. You have clearly misunderstood what I said. I said I'll put myself in the shoes of the user. By I have launched myself a game. I meant, that I am the user, and want to launch a game, and so I do. That is, I am the user, I want to launch a game, and I don't give a ... what other apps are running in the background. I don't want to see what others are twitting, I don't care what e-mails I might have received, and I don't give a about nothing. I am in the loo for 10 minutes, and I'm launching a game, I want to play the game, and I don't care about anything. It's my 10 private minutes in the loo, and I could care less of *anything* else. I don't care how much the system is hurt, I want ot play for crying out loud, and I want to play at full speed with the best quality possible. Do you now understand what I said? If we go down that path, 6 months from now we'll have requests for a permission that allows background apps to say I don't want apps to run in the foreground that prevent background apps from running, and their request will be just as reasonable as yours: their app doesn't coexist with yours, so they want to prevent yours from running (just like you want to prevent theirs from running). You are only strengthening my opinion that you have completely misunderstood what I said. It is all for the benefit of the USER, THE USER, not the developer, not the OS, not Google. If the user wants these services to run, he won't be playing the game, and hey, you could do an *even better* job *denying* the application this restriction, and running it as usual. Or give the user the ability to turn on and off this permission to any application at any time while the app is not running!!! Are you thinking that the iPhone is a failure because it doesn't allow background processing? Now, I realize that this permission should not be that simple - it should allow the apps to specify which components are OK to run (system components will always run, of course). For example, the RSS reader application will want to run itself, and this or that service it depends on. I don't see how this would be a problem. The permission should simply allow one or more components to be listed as dependencies. It's not as simple as it seems, as you're putting a requirement on background applications to identify which components they (transitively) rely on in order to work properly. Imagine that your app relies on component A, but that (as an implementation detail) component A relies on component B: now you need component A to identify that it needs component B, so that component B can also be made immune to the kill-by-game behavior. Actually I don't need to specify anything. I just proposed that. I now realize you can do it automatically. The second an app marked with the special permission binds to a service or accesses a content provider, it is more than obvious that the service, is indeed needed by the application and should be allowed to run. I think that we've gone way too far from the original problem. The original problem as I see it isn't about GCs in other apps, it's about behaviors that cause remote GCs in your game. I think it'd be much simpler if your game could say I don't want remote asynchronous GCs, and it would probably even be more
[android-developers] Re: Anything on Android that can do smooth scrolling?
On Thu, Mar 26, 2009 at 6:14 PM, Al Sutton a...@funkyandroid.com wrote: Got to say I'd prefer a good user experience to developer orientated features any day. Indeed. That's all I ask for! I hope it's not much. This is the *only* way Android will beat other phones. What good, if it could run a web server on the device, if one of the most selling types of applications (games, but this is NOT limited to games - video playback is important as well!) cannot offer great user experience? You (Google!, not you, Android engineers) need to listen to us! We're on YOUR side, we're not the enemy. The enemy is MacOS, Symbian, Windows Mobile, etc. Help us help you! Cheers --~--~-~--~~~---~--~~ 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: Anything on Android that can do smooth scrolling?
The problem with your reasoning is that it's far from obvious that your hypothetical user will clearly understand that launching your game will prevent their other apps from running (there's plenty of evidence that users don't understand the consequences of their actions as well as developers do). Of course, you'd like them to only care about your game, but you can't assume that this will be the case for everyone (and the situation gets worse if your game is really good and they spend a long time playing it). Please file a feature request for the no-GC feature so that we don't forget about it. how is it possible for other apps to trigger GC in my process? The system asks every relevant process to GC at different points in time, especially when it's running low on memory. That's not its only tool - it can also flush caches or kill processes when that's appropriate. Is Android so aggressive about launching as few processes as possible, that it won't run my app in a new process, even if the # of running proceses is low? As a developer, you have control over the way the components in your apps get spread into processes. If I remember correctly, you can split an app over multiple processes, and you can have components from different apps running in the same process. Even without caring about that level of control, you can still be sure that your apps' components won't run in the same process as app components from other developers, since that'd break the entire security model. Android currently does keep processes around when it has enough memory for it - there's a cost/benefit tradeoff, since an empty process takes space, but having it around saves a lot of time if it can be re-used to re-launch an application in it. JBQ On Thu, Mar 26, 2009 at 8:40 AM, Stoyan Damov stoyan.da...@gmail.com wrote: On Thu, Mar 26, 2009 at 5:24 PM, Jean-Baptiste Queru j...@android.com wrote: On Thu, Mar 26, 2009 at 7:25 AM, Stoyan Damov stoyan.da...@gmail.com wrote: Screw the developer. I'll put myself in the shoes of the user. I have launched myself a game. I want it to run at full speed. I could care less that a background service, polling RSS feeds have just found out that someone posted a new blog entry. I'm sure you now understand there's no issue with background apps and which is more important. You've just put yourself deeper in a position where you see your application as the most important one. Well, in the shoes of the user, you now have an application (your game) that hurts the entire system. When your app is running, the user doesn't receive their email any more, they don't get updates from twitter, latitude doesn't work... and there will probably be lots of other cases. You have clearly misunderstood what I said. I said I'll put myself in the shoes of the user. By I have launched myself a game. I meant, that I am the user, and want to launch a game, and so I do. That is, I am the user, I want to launch a game, and I don't give a ... what other apps are running in the background. I don't want to see what others are twitting, I don't care what e-mails I might have received, and I don't give a about nothing. I am in the loo for 10 minutes, and I'm launching a game, I want to play the game, and I don't care about anything. It's my 10 private minutes in the loo, and I could care less of *anything* else. I don't care how much the system is hurt, I want ot play for crying out loud, and I want to play at full speed with the best quality possible. Do you now understand what I said? If we go down that path, 6 months from now we'll have requests for a permission that allows background apps to say I don't want apps to run in the foreground that prevent background apps from running, and their request will be just as reasonable as yours: their app doesn't coexist with yours, so they want to prevent yours from running (just like you want to prevent theirs from running). You are only strengthening my opinion that you have completely misunderstood what I said. It is all for the benefit of the USER, THE USER, not the developer, not the OS, not Google. If the user wants these services to run, he won't be playing the game, and hey, you could do an *even better* job *denying* the application this restriction, and running it as usual. Or give the user the ability to turn on and off this permission to any application at any time while the app is not running!!! Are you thinking that the iPhone is a failure because it doesn't allow background processing? Now, I realize that this permission should not be that simple - it should allow the apps to specify which components are OK to run (system components will always run, of course). For example, the RSS reader application will want to run itself, and this or that service it depends on. I don't see how this would be a problem. The permission should simply allow one or more components to be listed as dependencies.
[android-developers] how to add --core-library to Eclipse ?
hi, I need to know how to add the parameter --core-library to Eclipse, especially to DEX. I managed to work around with activitycreator and ant scripts (build.xml), but this way it takes too long. Where can I configure this? Thanks, DaRolla --~--~-~--~~~---~--~~ 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: Anything on Android that can do smooth scrolling?
On Thu, Mar 26, 2009 at 6:23 PM, Jean-Baptiste Queru j...@android.com wrote: The problem with your reasoning is that it's far from obvious that your hypothetical user will clearly understand that launching your game will prevent their other apps from running (there's plenty of evidence that users don't understand the consequences of their actions as well as developers do). Of course, you'd like them to only care about your game, but you can't assume that this will be the case for everyone (and the situation gets worse if your game is really good and they spend a long time playing it). Not true. Just as the user understands if an application needs to read his contacts, and would deny it, if it's a flashlight application, he'll understand the permission, if explained in the user's language. Users, well, I hope most of them, are not imbeciles. They might not understand a lot of stuff, but you can explain them some things in an easy-to-understand language, and they'll grasp it. Please file a feature request for the no-GC feature so that we don't forget about it. Sure, will do. how is it possible for other apps to trigger GC in my process? The system asks every relevant process to GC at different points in time, especially when it's running low on memory. That's not its only tool - it can also flush caches or kill processes when that's appropriate. Got it. Is Android so aggressive about launching as few processes as possible, that it won't run my app in a new process, even if the # of running proceses is low? As a developer, you have control over the way the components in your apps get spread into processes. If I remember correctly, you can split an app over multiple processes, and you can have components from different apps running in the same process. Even without caring about that level of control, you can still be sure that your apps' components won't run in the same process as app components from other developers, since that'd break the entire security model. Android currently does keep processes around when it has enough memory for it - there's a cost/benefit tradeoff, since an empty process takes space, but having it around saves a lot of time if it can be re-used to re-launch an application in it. Thanks for the clarification. Cheers --~--~-~--~~~---~--~~ 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: Anything on Android that can do smooth scrolling?
I've already said this once -- even though your game can be tuned to the max, nothing prevents *other* apps from triggering GC. That is, in my game, I *never*, *ever* do any allocation after startup. However, other background processes do trigger GC, and voila - my game stutters for a bit when GC kicks in. Other apps CANNOT cause GC in your process. Background processes can interrupt your game but it has nothing to do with GC. -- 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] Parsing #xx; characters in XML
Hi all, I'm using a DOM parser to parse XML from Google News. Unfortunaltly, the XML is full of #39; characters and the parser cannot deal with them properly. Is there any way to achieve parsing correctly? Am I missing something? 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: Task activity stack always reset when launched from Home
The code that starts the .About activity is: protected void startAbout() { Intent aIntent = new Intent(this, About.class); startActivity(aIntent); } The Manifest entries for .UserLaunch and .About are in my original post. The intent that returns the task to the front is generated by the Launcher. What flags do I need to set (and where) to prevent this from happening? Is one of the default values causing it? My test case here is: 1) launch .UserLaunch from the launcher 2) start .About 3) hit Home key 4) launch .UserLuanch from the launcher There are no long delays in any of this, so the 30 minute auto-clear should not be invoked. - John On Mar 25, 12:15 pm, Dianne Hackborn hack...@android.com wrote: That means you are using some CLEAR_TOP or finish flag in an intent or in the manifest. Or possibly it has been 30 minutes since the app was last launched, in which case the system will restart it automatically. On Wed, Mar 25, 2009 at 11:12 AM, jseghers jsegh...@cequint.com wrote: Thank you for your reply! I am seeing am_task_to_front followed by am_finish_activity. I found the event-log-tags file and apparently the reason is clear. What is not clear to me though is why the activity manager thinks it should clear the the task. The relevant lines of the log are: I/am_on_resume_called( 94): com.android.launcher.Launcher I/dvm_gc_info( 94): [7017575181485176104,-9053780441931634733,-4010030953047537782,8554533] I/force_gc( 209): bg I/dvm_gc_info( 209): [7163384747111232651,-9098816781953771608,-4017912252395432053,7919391] I/am_pause_activity( 52): [1128800640,com.android.launcher/.Launcher] I/am_task_to_front( 52): 3 I/am_finish_activity( 52): [1129575992,3,com.cequint.cityid/.About,clear] I/am_destroy_activity( 52): [1129575992,3,com.cequint.cityid/.About] I/am_new_intent( 52): [112951,3,com.cequint.cityid/.UserLaunch,android.intent.action.MAIN,,, 274726912] I/am_on_paused_called( 94): com.android.launcher.Launcher I/am_resume_activity( 52): [1129749080,3,com.cequint.cityid/.UserLaunch] I/am_on_resume_called( 209): com.cequint.cityid.UserLaunch I/dvm_gc_madvise_info( 94): [290816,245760] I/dvm_gc_madvise_info( 209): [352256,241664] I/force_gc( 94): bg - John On Mar 25, 10:16 am, Dianne Hackborn hack...@android.com wrote: You can do adb logcat -b events to see the event log which will include a line the activity manager prints when finishing an activity, with the reason why it is doing it. On Tue, Mar 24, 2009 at 7:24 PM, jseghers jsegh...@cequint.com wrote: I am just starting on an Android app and I am puzzled about why my Task activity stack is being reset any time the application is launched from the Home screen. I used the ADT tools to create the application in Eclipse. The main activity is .UserLaunch and it starts the activity .About when the user presses a button. If the user then presses HOME and then relaunches the app, .UserLaunch is displayed and is the only thing on the stack. .UserLaunch has the launchMode singleTask. .About is standard. According to the documentation at http://developer.android.com/guide/topics/fundamentals.html#lmodes: However, a singleTask activity may or may not have other activities above it in the stack. If it does, it is not in position to handle the intent, and the intent is dropped. (Even though the intent is dropped, its arrival would have caused the task to come to the foreground, where it would remain.) The Task stack should be brought to the foreground and .About should still be displayed. I added Logging to all of the lifecycle events (edited to remove timestamps and shorten DEBUG/ and INFO/ to D/ and I/) and you can see that when HOME is pressed, .About cycles through onPause and onStop (as expected). Then when the app is again launched, .About is destroyed and .UserLaunch is restarted D/UserLaunch:(670): onCreate() D/UserLaunch:(670): onStart() D/UserLaunch:(670): onResume() I/ActivityManager(52): Displayed activity com.cequint.cityid/.UserLaunch: 4910 ms I/ActivityManager(52): Starting activity: Intent { comp= {com.cequint.cityid/com.cequint.cityid.About} } D/UserLaunch:(670): onPause() D/About(670): onCreate() D/About(670): onStart() D/About(670): onResume() I/ActivityManager(52): Displayed activity com.cequint.cityid/.About: 1031 ms D/UserLaunch:(670): onStop() I/ActivityManager(52): Starting activity: Intent { action=android.intent.action.MAIN categories= {android.intent.category.HOME} flags=0x1020 comp= {com.android.launcher/com.android.launcher.Launcher} } D/About(670): onPause() D/About(670): onStop() D/dalvikvm(670): GC freed 413 objects / 34128 bytes in 72ms I/ActivityManager(52): Starting activity: Intent {
[android-developers] Re: Market and Developer Frustration
9) The web interface for market is miserable. Why can't we see all the apps there? Why don't we have the same set of controls we do from the phone along with a discussion/blog for ratings. For whatever it's worth, I came here specifically looking for a discussion of this issue. In addition to the points he raises, it sure would be nice if my Google ID could be associated with the apps I've pulled down to my phone, and maybe even select apps to push to it -- or maybe set up favorites I could then page to on the phone and download from there. I guess I'm saying the web interface is bad but the phone interface isn't that great either. I'm setting up my second G1 after setting up my wife's about a week ago, and finding those must have apps out of the huge list of other apps is pretty time consuming and frustrating. Anyway, one more vote for big improvements to the Market web interface and the phone interface... --~--~-~--~~~---~--~~ 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 cast from View to MapView ?
hi, i'm new developer on Android. When i use this line i get 'cannot cast from View to MapView ' error. mapView = (MapView) findViewById(R.id.mapview); in R.java public static final class id { public static final int mainlayout=0x7f05; public static final int mapview=0x7f050001; public static final int zoomview=0x7f050002; } in main.xml com.google.android.maps.MapView android:id=@+id/mapview android:layout_width=fill_parent android:layout_height=fill_parent android:clickable=true android:apiKey= / i look this mapview application in tutorial in developer.android.com http://developer.android.com/guide/tutorials/views/hello-mapview.html How can i fix this problem? --~--~-~--~~~---~--~~ 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 start serial interface(RS232) code in Android
Hi All, I am beginner to android. I want user RS232 interface with android. Please suggest me where can I get sample code. Advance thanks for your help. Venkat --~--~-~--~~~---~--~~ 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] OutofMemory exception when dealing with large Bitmaps
I wrote a sample application which rotates and scales a bitmap on clicking a key. When the bitmap is large (1280x1024) I quickly run into an OutOfMemory exception at CreateBitmap and I need to Force Close the application. No issues with smaller bitmaps. I have already tried using bitmap.recycle and setting the bitmap to null, but the memory does not get freed up. I have seen multiple posts with similar issues, but could not find one that solves my issue. Do I need to force the GC at some point? Here is the code I am using: public class TransformAndroid extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); LinearLayout linLayout = new LinearLayout(this); mBitmapOrg = BitmapFactory.decodeResource(getResources(), R.drawable.sample); mScaleWidth = 0.1f; mScaleHeight = 0.1f; mRotateAngle = 0; mImageView = new ImageView(this); TransformThePicture(); // center the Image mImageView.setScaleType(ScaleType.CENTER); // add ImageView to the Layout linLayout.addView(mImageView, new LinearLayout.LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT ) ); // set LinearLayout as ContentView setContentView(linLayout); } private void TransformThePicture() { Matrix matrix = new Matrix(); matrix.postScale(mScaleWidth, mScaleHeight); matrix.postRotate(mRotateAngle); int width = mBitmapOrg.getWidth(); int height = mBitmapOrg.getHeight(); mResizedBitmap = Bitmap.createBitmap(mBitmapOrg, 0, 0, width, height, matrix, true); mImageView.setImageBitmap(mResizedBitmap); mImageView.invalidate(); } public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) { mScaleWidth += 0.08; mScaleHeight += 0.05; mRotateAngle += 5; if (mScaleWidth = 1.0f) mScaleWidth = 0.1f; if (mScaleHeight = 1.0f) mScaleHeight = 0.1f; if (mRotateAngle = 90) mRotateAngle = 0; mResizedBitmap.recycle(); TransformThePicture(); return (true); } return super.onKeyDown(keyCode, event); } private Bitmap mBitmapOrg; private float mScaleWidth; private float mScaleHeight; private int mRotateAngle; private ImageView mImageView; private Bitmap mResizedBitmap; } --~--~-~--~~~---~--~~ 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 1.1_r1 SDK released and developer.android.com launched
Will the 1.1 SDK eventually put back the Bluetooth API? Thanks. Android Developer On Feb 9, 6:31 pm, Justin (Google Employee) j...@google.com wrote: Hey developers, today we released the new, 1.1_r1 SDK. This SDK includes some minor updates that you can read more about on the blog,http://android-developers.blogspot.com/2009/02/android-11-sdk-release... . Also, we've launched the new developer site athttp://developer.android.com which has updated documentation for the 1.1_r1 SDK. Cheers, Justin Android Team @ Google --~--~-~--~~~---~--~~ 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] When save image, how to specify image name?
I have the following code to save a bitmap to a jpg file. It works except I couldn't specify the file name. The image file is save in /sdcard/dcim/Camera. How do I specify a file name, or even the saved path? Cheers ContentValues values = new ContentValues(); values.put(MediaStore.Images.ImageColumns.DISPLAY_ NAME, newpic); values.put(MediaStore.Images.ImageColumns.MIME_TYP E, image/jpeg); Uri uri = getContentResolver().insert(MediaStore.Images.Medi a.EXTERNAL_CONTENT_URI, values); try{ OutputStream out = getContentResolver().openOutputStream(uri); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out); }catch(IOException e){ Log.e(save image, failed to save image, e); } -- Kind Regards, Ren --~--~-~--~~~---~--~~ 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] RingtoneManager.ACTION_RINGTONE_PICKER
Hello. I tried to post earlier and my browser was acting funky. I don't see the post, so I am adding another. I apologize if both show up. I am using Android SDK 1.1_r1. I want a user to be able to open the ringtone picker, select a ringtone, it the OK button and have the result sent back to the parent activity. When I start the ringtone picker as a sub-activity, it appears to call setResult() immediately. I could be way off and just not understand how this works. Here is the code that I am using to lauch the sub-activity: mPickRingTone.setOnClickListener(new View.OnClickListener() { public void onClick( View v ) { ringMe.startRingPick(); } }); private void startRingPick() { Intent i = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER); startActivityForResult(i, ACTIVITY_SET_RINGTONE); } @Override protected void onActivityResult( int requestCode, int resultCode, Intent data ) { switch( requestCode ) { case ACTIVITY_SET_RINGTONE: Log.d(toString(), ACTIVITY_SET_RINGTONE DONE); // this method takes the data getToneToRing(data); } super.onActivityResult(requestCode, resultCode, data); } When I press the button the ringtone picker dialog opens and immediately I see ACTIVITY_SET_RINGTONE DONE via LogCat. This is on a physical device. Do I not understand something? --~--~-~--~~~---~--~~ 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] Location API Country code
Earlier in the year my location application was pulling the Country Code of US, now the app pulls the Country code as United States, which is jacking up my web link generation process. Did the API values change? If so, when? 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: Market and Developer Frustration
Interesting, it seems T-Mobile agrees... http://www.pcworld.com/article/161410/android_market_needs_more_filters_tmobile_says.html --~--~-~--~~~---~--~~ 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] MapView
Hi everyone, i'm a new developer on Android. I need your help. I look tutorial HelloMapView on http://developer.android.com/guide/tutorials/views/hello-mapview.html . i use eclipse ADT for developing and at this line a get an error at compiler time. mapView = (MapView) findViewById(R.id.mapview); Error : Cannot cast from View to MapView mapview in associated files mapview in layout file com.google.android.maps.MapView android:id=@+id/mapview android:layout_width=fill_parent android:layout_height=fill_parent android:clickable=true android:apiKey=APiKEy / LinearLayout android:id=@+id/zoomview android:layout_width=wrap_content android:layout_height=wrap_content android:layout_alignBottom=@id/mapview android:layout_centerHorizontal=true / R.java public static final class id { public static final int mainlayout=0x7f05; public static final int mapview=0x7f050001; public static final int zoomview=0x7f050002; } I didn't do different things from tutorial. How can i fix it? Thanks for your replies. --~--~-~--~~~---~--~~ 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] Routing UDP data to the emulator
I've been scouring the forums and found similar issues like this, but the solutions seems not to be working. What we're doing is trying to receive data from an external server via UDP. At the moment, doing a tcpdump on linux provides information that yes, there is data coming into my computer. From here, however, things become murky. I have tried the following two tactics: telnet localhost 5554 redir add udp:5000:5000 where 5000 is the port on my computer that is receiving data and 5000 is the port where Android is listening to. This achieves nothing. The other tactic is the adb forward, which has the same results. The UDP Server code is as follows: public class Server extends Thread { private InetAddress serverAddr; private DatagramSocket socket; private static int port = 5000; private static final String tag = UDP Server; public Server() { try { this.serverAddr = InetAddress.getByName(10.0.2.15); this.socket = new DatagramSocket(port, this.serverAddr); Log.d(tag, listening port 5000); } catch (Exception e) { Log.d(tag, Failed accessing server address and socket); } } public void start() { super.start(); } public void run() { Looper.prepare(); while(true) { try { byte[] buf = new byte[43]; /* Prepare a UDP-Packet that can * contain the data we want to receive */ DatagramPacket packet = new DatagramPacket(buf, buf.length); this.socket.receive(packet); // Receive the UDP-Packet Log.d(tag, Received: ' + new String(packet.getData()) + '); } catch (IOException e) { Log.e(tag, Error, e); } } } } What this should do is listen to Android's network/ethernet interface and output the recieved data (if there is any). What I get is nothing. Android does not say that there is an error in Logcat or that anything is received. This seems to tell me that the information is not being redirected properly to the emulator. Any thoughts on getting this redirection business settled? --~--~-~--~~~---~--~~ 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: Notepad Exercise 1 solution gives weird errors
For anyone still having problems these files are hidden files that start with '.' On Mar 1, 9:52 pm, plankeye back_in...@yahoo.com wrote: Just in case you haven't gotten an answer yet, there are three unwanted files in the Notepadv1\src\com\android\demo\notepad1 directory. Delete these files and refresh the project and you'll be on your way. On Feb 22, 4:33 pm, mpxy mpx...@gmail.com wrote: Hi everybody, I'm a beginner in development in Android. I've downloaded and begin going through Notepad Exercise, however, even when I try running the the solution of Exercise 1, I get the following 4 errors: Invalid character constant ._Notepadv1.java Notepadv1/src/com/android/ demo/notepad1 line 1 Java Problem Syntax error on tokens, delete these tokens ._Notepadv1.java Notepadv1/ src/com/android/demo/notepad1 line 1 Java Problem Syntax error on tokens, delete these tokens ._NotesDbAdapter.java Notepadv1/src/com/android/demo/notepad1 line 1 Java Problem Syntax error on tokens, delete these tokens ._R.java Notepadv1/src/com/ android/demo/notepad1 line 1 Java Problem I'm using Windows XP and Eclipse. Are there anybody who had the same problem, or does anyone have any idea about their reason? 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: Dynamic Forms UI
On Thu, Mar 26, 2009 at 1:01 PM, Ahmad ahmad...@gmail.com wrote: I want to create a form designer application like user can create custom form layouts .. there might be a list of all available controls (TextView, EditText, Button, RadioButton etc ) and an add button and user can add his new form layout on android that can be further saved on android using sqllight. i have started work on that but i could not break line . all controls are added on the same line .. here is my code that executes on button click [code] @Override public void onClick(View v) { int i=compList.getSelectedItemPosition(); Log.w(3 -- CreateNewForm, onClick : selected item index is :+i ); switch (i) { case 0: LinearLayout layout = new LinearLayout(getApplicationContext()); TextView label = new TextView(getApplicationContext()); EditText txt = new EditText(getApplicationContext()); label.setText(untitled); label.setPadding(5, 3, 10, 3); layout.addView(label); layout.addView(txt); LinearLayout container = (LinearLayout) findViewById(R.id.compDetails); container.addView(layout); // container.addView(textView); break; default: break; } } [/code] -- Ahmad Nadeem J2EE Software Engineer Archimedes Services Ltd. http://www.linkedin.com/in/ahmadnadeem --~--~-~--~~~---~--~~ 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] Wireless voice over IP
Hi, I would like to know the best way to go about building a wireless voice over solution for the android platform? I know the question might be too general, but I would like to details such as which voice over IP server to use. In addition to this would it be possible to encrypt and decrypt packets before transmitting in order to make it secure? Would this affect the call clarity. Thanks, Hades. --~--~-~--~~~---~--~~ 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] Dynamic Forms UI
I want to create a form designer application like user can create custom form layouts .. there might be a list of all available controls (TextView, EditText, Button, RadioButton etc ) and an add button and user can add his new form layout on android that can be further saved on android using sqllight. i have started work on that but i could not break line . all controls are added on the same line .. here is my code that executes on button click [code] @Override public void onClick(View v) { int i=compList.getSelectedItemPosition(); Log.w(3 -- CreateNewForm, onClick : selected item index is :+i ); switch (i) { case 0: LinearLayout layout = new LinearLayout(getApplicationContext()); TextView label = new TextView(getApplicationContext()); EditText txt = new EditText(getApplicationContext()); label.setText(untitled); label.setPadding(5, 3, 10, 3); layout.addView(label); layout.addView(txt); LinearLayout container = (LinearLayout) findViewById(R.id.compDetails); container.addView(layout); // container.addView(textView); break; default: break; } } [/code] --~--~-~--~~~---~--~~ 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] RingtoneManager.ACTION_RINGTONE_PICKER
Hello. I am trying to allow someone to choose a ringtone and to get the URI or order number of this and pass it back to the parent Activity. Maybe I am going about this the wrong way. The problem that I am having is startActivityForResult() launches the ringtone picker but immediately call setResult(). However the ringtone picker seems to work fine, i just cannot capture the value of the picked tone(that part of the code is not here because it never gets that far). Here is how I am trying to do this: calling it from a listener: mPickRingTone.setOnClickListener(new View.OnClickListener() { public void onClick( View v ) { startRingPick(); } }); private void startRingPick() { Intent i = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER); startActivityForResult(i, ACTIVITY_SET_RINGTONE); } @Override protected void onActivityResult( int requestCode, int resultCode, Intent data ) { switch( requestCode ) { case ACTIVITY_SET_RINGTONE: Log.d(toString(), ACTIVITY_SET_RINGTONE = + ACTIVITY_SET_RINGTONE); } super.onActivityResult(requestCode, resultCode, data); } --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---