[android-developers] High resolution icon require to make my app not Mature - What the heck?
So I get a message from google saying that I need to update the content rating on my apps because otherwise they will default to mature. So fine, pull up the developer console, check All, hit save. High resolution icon required. Really now? Is it? Haven't touched my icons in like a year - and I certainly don't have the time to fart around creating a 512x512 (!) version of them just to be able to make sure my app isn't rated XXX. Who made the decision to make the high res icon required, and how do I work around it? -- 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] Got my free DROID, who's paying for service?
So as part of the Google device seeding program I recently recieved my free Droid. Great phone, and it appears to have wireless and data service. I've done nothing to activate it and I can make calls and surf the web over 3G. My question is, who's paying for it? I tried to activate the phone in my name. No dice. I called Verizon and they said it was on a corporate or concession account. So do I just have a totally free phone with free calls/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 To unsubscribe, reply using remove me as the subject.
[android-developers] Re: Got my free DROID, who's paying for service?
Ok, but then what? The letter that came with it said that I could activate it and get a free month, or just use it over wi-fi. But that appears not to be the case. It's already been activated by somebody else, and Verizon customer support can't do seem to do anything with this phone. They said I had to have a corporate contact to be able to manage the account. Will that change after the month is up? Will I be able to activate it in my own name then? On Apr 1, 3:33 pm, SizzlingSkizzorsProgrammer cbo...@gmail.com wrote: Probably like the IONs given away at Google IO (I think it was there)...free for 1 month... On Apr 1, 1:30 pm, joshv jvanderb...@gmail.com wrote: So as part of the Google device seeding program I recently recieved my free Droid. Great phone, and it appears to have wireless and data service. I've done nothing to activate it and I can make calls and surf the web over 3G. My question is, who's paying for it? I tried to activate the phone in my name. No dice. I called Verizon and they said it was on a corporate or concession account. So do I just have a totally free phone with free calls/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 To unsubscribe, reply using remove me as the subject.
[android-developers] Re: concurrency of AsyncTasks
Interesting issue. I can see the need to make this configurable though. In some cases it would be nice to make sure that these background tasks do not run concurrently as concurrency issues can result. For example, I might have a URL fetch tied to a user interface button. When the URL returns, I update an internal model with new data. If the fetch is slow to load, the user will keep mashing the button, resulting in multiple requests. It would be nice to have those requests single threaded, rather than having to worry about 5 requests returning asychronously, and having to synchronize my model update code. Also, as it appears that the default is currently single threading, a change to make the pool larger could break any apps that depend on the single threading behavior. On Jun 26, 12:24 pm, Romain Guy romain...@google.com wrote: Hi, It's a bug and your workaround is correct. I'll fix this right away. On Fri, Jun 26, 2009 at 9:27 AM, Jayesh Salvijayeshsa...@gmail.com wrote: Hi, I am replacing the multithreaded code in my app with the AsyncTask from 1.5. I found that two AsyncTasks do not work concurrently. I investigated a bit and found a workaround; I would like second opinion if my solution is right. OR if there is a better solution. AsyncTask allows the app to do a task on a thread other than the UI thread. But IIUC, it only provides a single thread on which a queue of tasks is performed. Therefore, if one of the task is to wait on some event (n/w or sleep) then all other tasks will wait for it to finish. To elaborate with the coding example: code public class MyTask extends AsyncTask... { ... } // On the UI thread execute two tasks MyTask mt1 = new MyTask().execute(args); MyTask mt2 = new MyTask().execute(args); /code In the above code both the execute calls will return immediately and free up the UI thread; however mt1 will be executed first and mt2 will have to wait until mt1 finishes. Thanks to the android's open source, we can see implementation of AsyncTask. http://google.com/codesearch/p?hl=ensa=Ncd=2ct=rc#uX1GffpyOZk/core... I copied AsyncTask.java as UserTask.java in my project and changed the value of CORE_POOL_SIZE to 5. This makes the thread pool to use 5 threads to multiplex the queued AsyncTasks. This indeed solved my problem. Now if mt1 blocks on a sleep; mt2 goes ahead and finishes its job. Here are some questions for those who know more about AsyncTask implementation: Is this work-around right? If yes, can the CORE_POOL_SIZE be made configurable in future, via an API call? Is there a solution by which multiple thread pools can be used? Let me add that, I am aware that this is a phone and not a web server - I am not using 10s of threads to do network I/O. However a single thread is not sufficient for my app either. Please let me know. Thanks in advance. Jayesh -- 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] Re: Android Dev Phone Battery life
Yeah, I am lucky to go a full day on one charge. 90 minutes of web surfing (on the bus to and from work) will easily kill an entire charge. If I just leave the thing in standby, with wi-fi off, it might last 2 days. On Dec 19, 10:57 am, Vladimir Kelman vkel...@gmail.com wrote: Hi! For how long do your Android Phone Batteries stay after being fully charged? It's kind of bad to me: just 3-4 days. My simple Samsung phone was working a week without recharging. --~--~-~--~~~---~--~~ 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: % character not displayed correctly by WebView?
Use loadDateWithBaseURL - pass it a dummy base URL. On Dec 19, 7:43 am, Inderjeet Singh inder...@gmail.com wrote: The following code snippet produces a weird browser error (Web page not available) on WebView: String message = htmlbodyShow Percent: 38% /body/html; WebView mWebView = (WebView) activity.findViewById(R.id.my_web_view); mWebView.loadData(message, text/html, en_US); The offending character is %. I tried using the entity code for %, but it made no difference. Anyone knows what is going on? Thanks Inder --~--~-~--~~~---~--~~ 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] What determines Android Market popularity ranking
I've posted this question to the Market technical support forum and received no answer, so I will try here. Does anyone know what metrics are used to determine an application's popularity in the Android Market? It does not appear to involve just the number of ratings, the download count, or the average rating, as there are applications which are persistently ranked lower by popularity even though they have higher download counts, higher total ratings, and higher average ratings than other apps that are more popular in the same category. I don't want to point to specific apps in this post, but it should be easy enough to find examples. If a Google employee is interested in specific examples, contact me directly. --~--~-~--~~~---~--~~ 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: BaseAdapter getView question
In my adapter code I only ever return a single type of view from getView(). This view always has a field with an id of R.id.name. A non-zero percentage of the time I am given a convertView in the parameters passed to getView() and the code: convertView.findViewById(R.id.name) will return null. I have no idea what view the framework is passing to me, but it bears no resemblance to anything I returned from getView. On Dec 18, 10:20 am, Mark Murphy mmur...@commonsware.com wrote: loty wrote: I can definitely do the same but it seems super strange to me that it would return anything other than what I created in the initial call. getView() gets called more than once. Is there any rhyme or reason for what this function gets in the convertView parameter? Sure. It's a View that is being recycled. It is one of the ones you created earlier. Exactly *which* one of the ones you created earlier is unpredictable, since it is based upon user actions, mostly scrolling or otherwise traversing the list. Very very mysterious explanation - we'll send you a view and it may or may not be the right view. My guess is that you are thinking of lists containing only a single sort of entry. There's nothing in the AdapterView API that requires all Views returned by the adapter's getView() to all be the exact same type of View. There is nothing preventing you from creating an Adapter that returns multiple disparate types of views. For example, I have a ListView that returns Views for email addresses, phone numbers, mailing addresses, and what could best be described as menu choices. Each of those views are a bit different in their layout. That's part of the reason they added in getViewTypeCount() and getItemViewType(int position), to help them be more efficient about the recycling process, to increase the odds that the convertView passed into getView() is one you *can* recycle. -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.9 Published! --~--~-~--~~~---~--~~ 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: BaseAdapter getView question
It makes no sense to me either - I *always* return the same type of view from getView so I have no idea why the framework would ever send me a view of a different type. On Dec 18, 10:11 am, loty lev.pert...@gmail.com wrote: Thanks josh, I can definitely do the same but it seems super strange to me that it would return anything other than what I created in the initial call. Is there any rhyme or reason for what this function gets in the convertView parameter? Here what Android docs say --convertView-- The old view to reuse, if possible. Note: You should check that this view is non-null and of an appropriate type before using. If it is not possible to convert this view to display the correct data, this method can create a new view. Very very mysterious explanation - we'll send you a view and it may or may not be the right view. You may or may not use it. I don't know what google dudes were smoking but I would like to know where they get the good stuff. On Dec 18, 10:37 am, joshv jvanderb...@gmail.com wrote: In my adapter code I take the convertView supplied, if not null, and then attempt to do a findViewById for a field I know should be in the view. If it's there, I use the view, if it's not, I recreate the view from scratch. On Dec 18, 8:45 am, loty lev.pert...@gmail.com wrote: I have a question about getView method of BaseAdapter that I overwrote to populate my GridView. All is well when convertView parameter is null - I create my views for cells and populate them, works and looks great. The problem is when my data is updated and notifyDataSetChanged(); is called somewhere else in my app convertView parameters in getView are all screwed up. Here is an example. I created Button view for position 0 and the rest TextViews. When I get getView calls with convertView not null for position 0 it's not a Button that I created but a TextView - WTF? For now I just ignore convertView parameter and always create new views but clearly either I don't understand something here or it's a bug. I hope it's 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: Creating reusable components for use across multiple packages
I do not believe there is any way to share code via an apk deployment. Each application is an island, and can use only the system libraries, and the code shipped in its own apk. On Dec 16, 12:28 pm, Mark mark.nuetzm...@gmail.com wrote: If I am interested in creating custom views, services, and utilities that would be used by multiple application packages what is the best way of handling the installation of these from an .apk file perspective? I am new the to the Java/Android scene and come from a Windows Mobile background where I could simply deploy multiple dlls in a single CAB file. Is there a similar method for Android that would allow me to provide everything I need in a single .apk file? Or am I totally missing something that is totally obvious... thanks so much, Mark --~--~-~--~~~---~--~~ 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: Keeping a Service Alive
I am currently researching the way to do this right and find the response below a bit interesting. It would seem that any and all long lived background services are being heavily discouraged. What I want to do is periodically check url that returns data. If the change in data between one request and the next is large enough (user set threshold) I want to send a notification to the user. This is the MOST requested feature for my application. I cannot see how to accomplish this if I only check data that meets the threshold when the application is running. The users want the thing to go off in their pocket, that's the whole point - they don't want to be constantly running my app. So how do the google apps do this - for example email and IM? Do they have long lived services that run in the background - or is there some other notification process that they are utilizing? On Nov 23, 6:47 pm, Dianne Hackborn hack...@android.com wrote: Please please please be sure to stop the service when it is no longer needed. For a media player, this generally means only having it in the running state when it is actively playing music; otherwise it should only be needed when there are clients bound to it. If you don't stop your services, then the system has to assume it is needed forever and can't remove your process to allow for other things the user is actually doing. I think this is actually one of our biggest third party application issues, applications that just starts a service and never stops it. This sucks for the user, and just should not be done. In fact there is already code in the system to look for services that have been running a long time without others doing things to them to let them be killed, but it's pretty clear we'll need to be even more brutal about this. :( (Which sucks for things that really do want to run for a long time, like a media player, but it's not clear at all to me what to do about them.) Also, there was a suggestion earlier to try running the service in another process. Multiple processes is again something to be careful of, and to stay away from unless you really need them -- processes are quite heavy-weight entities, so shouldn't be thrown around lightly. On Sun, Nov 23, 2008 at 12:42 PM, G ghack...@gmail.com wrote: EUREKA! I've figured it out based on some of the documentation I missed. For those who also have trouble... The docs for ContextWrapper.startService(Intent service) includes the following line... Using startService() overrides the default service lifetime that is managed by bindService(Intent, ServiceConnection, int): it requires the service to remain running until stopService(Intent) is called, regardless of whether any clients are connected to it. This is the trick, simply run startService() before you attempt to bind to it! So before, my onCreate contained: bindService(new Intent(MDService.class.getName()), mConnection, Context.BIND_AUTO_CREATE); Now this has been replaced by: Intent i = new Intent(MDService.class.getName()); startService(i); bindService(i, mConnection, Context.BIND_AUTO_CREATE); After that change, calling unbindService(mConnection) does NOT destroy the service :) So starting a service by binding it from an activity links the service's life-cycle with that of the activity. While starting the Service first, gives it it's own lifecycle, and you can still bind to it right after. (And you still know the service will only actually be started once.) Also, doing this seems to have alleviated my 2nd problem that I described in my 1st post, but this requires a little more testing before i can confirm it. On Nov 23, 3:09 pm, G ghack...@gmail.com wrote: I just realized that the in API Demo for Remote Service Binding, the service is destroyed when the activity is destroyed as well. So it's no help in this case. Can anyone point to a code sample in which a service outlives it's binding in an activity? Do I need to use a BroadcastReceiver or something? I'm very confused :( On Nov 23, 2:46 pm, G ghack...@gmail.com wrote: That is what I've been trying to do, below is the service definition in my AndroidManifest.xml file service android:name=.MDService android:process=:remote intent-filter action android:name=com.episode6.android.carolla.MDService/ action /intent-filter /service And I bind the service in my activity with the following call... bindService(new Intent(MDService.class.getName()), mConnection, Context.BIND_AUTO_CREATE); And whenever I run unbindService(mConnection); the service still gets destroyed. On Nov 23, 1:52 pm, Mark Murphy mmur...@commonsware.com wrote: G wrote: 1) When my main activity is destroyed, my service is getting destroyed along with it. The service's onDestroy
[android-developers] Re: Whose supporting VGA/QVGA at the moment?
I'd like a way of just being able to say my app doesn't work at anything less than X resolution. I've tested with QVGA and honestly it's just not worth the effort to recode my apps to work well with half of the screen resolution. It's possible, but the end result wouldn't be something I'd consider to be a usable app. In fact I find the Android OS itself pretty much unusable at that resolution - but maybe I am just spoiled. I guess I can put in alternate layout resources that say We don't support this resolution - but that's a pretty bad user experience for somebody who's just excitedly downloaded my app. I think the Android Market really needs to support specifying the resolutions and app requires and/or supports. On Dec 15, 5:51 am, Al Sutton a...@funkyandroid.com wrote: Given the G1 has an HVGA sized screen I'm wondering how many people are testing their layouts for QVGA devices (such as the Koogan Agora) and VGA devices (such as the Neo FreeRunner)? At AndAppStore we're adding in support for listing the supported devices on an app so I'm wondering if it would be more sensible to just list screen sizes and orientations along with a help box so people know what they can use. I'd be interested in people views. Al.http://andappstore.com/ -- == Funky Android Limited is registered in England Wales with the company number 6741909. The registered head office is Kemp House, 152-160 City Road, London, EC1V 2NX, UK. The views expressed in this email are those of the author and not necessarily those of Funky Android Limited, it's associates, or it's subsidiaries. --~--~-~--~~~---~--~~ 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: Installation unsuccessful - Package file was not signed correctly
I followed the instructions properly when creating the cert, and it's valid until 2033. As I mentioned, I only had to remove the offending file, re-sign the apk, and everything worked just fine, with the exact same certificate, so the cert hasn't expired. There's either something wrong with the export/packager, or something wrong with the PackageParser. I just hope I don't bump into this again, as it appears to be quite random - there was nothing special about the animation file that the PackageParser died on. On Dec 15, 1:25 pm, Mark K mark.ka...@gmail.com wrote: Is your self generated certificate valid until 2033? If you use the default, it will only have a validity of 180 days, use -validity 1 when generating your cert. Just something to check. Maybe try generating a new cert. M On Dec 14, 10:46 pm, joshv jvanderb...@gmail.com wrote: I am becoming somewhat terrified of uploading upgrades to my market apps, because it always seems to break something. This time around, I followed the exact same process as I always do, export the unsigned jar, sign it, verify that its signed with jarsigner -verify and then upload it as an upgrade to the market. When I attempt to install the app from the market I get Installation unsuccessful, with the reason Package file was not signed correctly. Which is somewhat amazing to me, because the upload page won't let you upload an unsigned jar. Am I missing something here? I used the exact same command line to sign the jar that I've used for the past updates that worked: jarsigner -verbose -keystore c:\path_to_keystore application.apk quirk And no, I have NOT changed my certificate, it's been the same since I created it, and has been used for many previous updates. Basically at this point I had to remove my app from the market as nobody can install it. Any ideas on how to trouble shoot? --~--~-~--~~~---~--~~ 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] Installation unsuccessful - Package file was not signed correctly
I am becoming somewhat terrified of uploading upgrades to my market apps, because it always seems to break something. This time around, I followed the exact same process as I always do, export the unsigned jar, sign it, verify that its signed with jarsigner -verify and then upload it as an upgrade to the market. When I attempt to install the app from the market I get Installation unsuccessful, with the reason Package file was not signed correctly. Which is somewhat amazing to me, because the upload page won't let you upload an unsigned jar. Am I missing something here? I used the exact same command line to sign the jar that I've used for the past updates that worked: jarsigner -verbose -keystore c:\path_to_keystore application.apk quirk And no, I have NOT changed my certificate, it's been the same since I created it, and has been used for many previous updates. Basically at this point I had to remove my app from the market as nobody can install it. Any ideas on how to trouble shoot? --~--~-~--~~~---~--~~ 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: Installation unsuccessful - Package file was not signed correctly
Solved my own problem by watching logcat during the installation: 12-15 01:28:27.722: ERROR/PackageParser(56): Package com.quirkconsulting.ticker has no certificates at entry res/anim/ push_down_in.xml; ignoring! I removed this particular file, re-exported/signed the apk, and it worked perfectly. jarsigner -verify reported this file as signed, but something about it killed the PackageParser. Could this be related to this bug? http://code.google.com/p/android/issues/detail?id=830 -josh On Dec 15, 12:46 am, joshv jvanderb...@gmail.com wrote: I am becoming somewhat terrified of uploading upgrades to my market apps, because it always seems to break something. This time around, I followed the exact same process as I always do, export the unsigned jar, sign it, verify that its signed with jarsigner -verify and then upload it as an upgrade to the market. When I attempt to install the app from the market I get Installation unsuccessful, with the reason Package file was not signed correctly. Which is somewhat amazing to me, because the upload page won't let you upload an unsigned jar. Am I missing something here? I used the exact same command line to sign the jar that I've used for the past updates that worked: jarsigner -verbose -keystore c:\path_to_keystore application.apk quirk And no, I have NOT changed my certificate, it's been the same since I created it, and has been used for many previous updates. Basically at this point I had to remove my app from the market as nobody can install it. Any ideas on how to trouble shoot? --~--~-~--~~~---~--~~ 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 problem
It appears to be back up. I republished and all my ratings and comments are back in the store. The developer console though shows no ratings/downloads... Hopefully it catches up. On Dec 3, 2:51 am, sam [EMAIL PROTECTED] wrote: It just fixed. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: market problem
No, I attempted to upload an upgrade to my app, which changed only the icon and the version number. There appeared to be some issue with the uploaded of the upgrade, and then suddenly my app reverted to a saved draft and disappeared from the app store. Attempting to publish the old app doesn't work - clicking the Publish button does nothing. Attempting to create a new application doesn't work, as I can't publish new applications either. There appears to be no means of contacting anything like a help desk or support. On Dec 2, 11:23 pm, Xavier Mathews [EMAIL PROTECTED] wrote: So let me get this stright.all of you all have created a appand because android has updated your apps have became outdated and can not be updated and uploaded. So now you must go through the trouble of recreating your app. Right? On 12/02/2008, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: This is starting to annnoy me. I didnt spend all day coding bug fixes etc to lose my app and not be able to upload a new version. On Dec 2, 11:59 pm, joshv [EMAIL PROTECTED] wrote: Same thing happened to me. I still have the original app id entry in the developer console, but all of the ratings are gone, I can't publish it, and it's not in the store any longer. All I tried to do was upload a newer version with a new icon. Let's hope somebody will restore my app. On Dec 2, 6:51 pm, jacek [EMAIL PROTECTED] wrote: I just tried to upgrade my app (nyt.flix -- for browsing The New York Times Movie Reviews) to a subsequent higher version using the usual mechanism that so far has worked. Today, however, nothing happens after I click publish. Worse, the application has disappeared from the market altogether (it used to be in the Entertainment area) and was first published a week ago. Anybody knows what's going on? -- Xavier A. Mathews Student/Browser Specialist/Developer/Web-Master Google Group Client Based Tech Support Specialist Hazel Crest Illinois [EMAIL PROTECTED]@[EMAIL PROTECTED] Fear of a name, only increases fear of the thing itself. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SharedPreferences problem
Ok, then SharePreferences should be ok in multi-threaded applications. Regarding process death and preferences, I thought the same thing so I scaled back my persistence code to only save preferences in an onPause (). It was my understanding that even when a task is killed, the onPause is called before the process is terminated - is that not the case? Can the process be killed in the middle of the onPause() processing? Perhaps this is a debugger only phenomenon? On Nov 30, 11:41 pm, Dianne Hackborn [EMAIL PROTECTED] wrote: It means multiple processes, as per: http://code.google.com/android/intro/appmodel.html What may be happening is that you are writing the new shared preferences at the same time as the system kills the process, so the file write is not completed, and the next time it is read it is unable to parse the truncated file. So you should only write the shared preferences at a time when you know the system is keeping your application around -- in onReceiveIntent(), a service, as part of the activity lifecycle, etc. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SharedPreferences problem
I did not mean to imply that the termination process called onPause() - merely that I can safely assume that onPause will be called previous to process termination - except as you note, in exceptional circumstances (note that a phone shutdown appears to be one of these exceptional circumstances). BTW, I've replaced SharedPreferences with a simple Properties object which I manually save to a local file, and I have not, as of yet, been able induce the application to loose it's settings. Being very paranoid, I even save the Properties object to a temp file, and then copy the file over the main preferences file, hoping that the copy operation is native and atomic enough that, even in the event of abnormal process termination, the copy will either succeed and replace the original file, or fail and leave the original file intact. On Dec 1, 1:19 pm, Dianne Hackborn [EMAIL PROTECTED] wrote: There is nothing called before the process is terminated, if you are thinking of it as the system thinks it needs to kill something, so politely asks it to get ready and then kills it. What actually happens it that onPause is called when the system is going to put the process in a background state, and from there at whatever point the system needs to get rid of the process it will just kill it, no questions asked. While onPause() is running, the process is in a foreground state, so it will not be killed unless the system is so low on memory it needs to kill that process to continue to have memory for the core system processes... which should only happen if the app is just using all of the available memory so that not even background things can run. Basically never for non-buggy apps. However, your process can get killed if you are installing an update to it, because the first thing the system does is cleanup and kill all existing code of the process before installing the update. We should probably do something to make this a little more clean for users installing updates. And this same thing happens every time you run your app from eclipse, since all it is really doing is telling the system to update to your current version of the app. -- Dianne Hackborn Android framework engineer [EMAIL PROTECTED] 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: G1 detected as 'offline' by Eclipse plugin
Make sure stay awake in the Application | Development menu settings is enabled - if I don't have that enabled, adb will regularly crash when the phone goes to sleep. Sometimes unplugging the phone's USB cord and plugging it back in will help, but sometimes I've found that periodically the windows drivers will just stop working, and adb can't see the phone no matter what I do - I basically have to reboot to restore connectivity. Are you sure the drivers installed properly to begin with? -josh On Dec 1, 2:34 pm, GiladH [EMAIL PROTECTED] wrote: Guys, I can debug my app just fine with the emulator. However, when I connect my G1 device to desktop via USB and attempt to run/debug my app on it (after following Developing on Device Hardware steps in android docs) I fail. The error msg I get: Failed to upload MyAppName.apk on device 'HT841LC09904': Unable to open sync connection! Running adb devices displays the G1 device is as 'offline'. The G1 relevant configuration values are: - Wireless controlsAirplain mode==true - SDCard Use for USB storage==false - ApplicationUnknown Resources==true - DevelopmentUSB Debugging==true Also - application section of manifest app contains: android:debuggable=true Any helpful idea will be welcomed. GiladH --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How about making an internet-less GPS system?
Xavier, I think the point is to have something that works even when data networks are not available. Google Maps won't work without a data network. -josh On Nov 30, 3:55 pm, Xavier Mathews [EMAIL PROTECTED] wrote: But there is also Google Maps on the phones! Xavier A. Mathews Student/Browser Specialist/Developer/Web-Master Google Group Client Based Tech Support Specialist Hazel Crest Illinois [EMAIL PROTECTED]@[EMAIL PROTECTED] Fear of a name, only increases fear of the thing itself. On Sun, Nov 30, 2008 at 12:28 AM, Vendetta [EMAIL PROTECTED] wrote: Just as normal GPS systems, how about having local area maps saved onto the micro SD instead of having to use google maps via internet? For instance, I'm lost and somehow 3g doesn't work and I don't have any other type of internet access. Wham! I'll use my offline normal GPS system! I think this app would be awesome, be sure to make one for Dallas, TX first! 3 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: call to determine current context?
Can't the calling Activity pass a reference to itself? On Nov 30, 2:10 pm, Peter Jeffe [EMAIL PROTECTED] wrote: I can't find any way to determine my current context, I'm hoping I'm just missing it, but maybe I'm missing something about contexts. I have a singleton object that maintains a connection to a service on behalf of potentially multiple activities, and I need to be able to bind/unbind on their behalf, and it's impractical (and maybe impossible) to know which context I'm running under at any given point. So I just want to be able to determine the context from down in the call stack. Thanks for any help. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SharedPreferences problem
What exactly do the docs mean when they say 'multiple processes'. Do they mean different threads in the same application? Or do they mean for example a background service accessing a shared preference file at the same time a foreground process is accessing the same shared preference file? I am having intermittent issues with one of my apps loosing it's shared preferences. My app uses threads to keep the UI responsive, and I just figured I had some sort of synchronization issue with saving preferences. But no, I've locked down the critical sections with synchronized blocks and still, very rarely, my app will lose it's preferences. It usually seems to happen when the app is killed by the OS, or by the debugger, normal resume/pause events never result in loosing the preferences. But again it's intermittent. I have another app that's never lost it's preferences - but it's not multi-threaded. -josh On Nov 19, 1:55 pm, Dianne Hackbod [EMAIL PROTECTED] wrote: [snip...] I'm not sure I follow your reasoning -- if you are saying that your application is all running in one process, why do you think the whole caveat about not supporting multiple processes even applies? [...] --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Flaky network connections
I am not sure you are experiencing the same thing I am. It's not a transient waiting for the radio to turn on phenomenon. I spent several hours last night working with NetworkInfo. When NetworkInfo says I am connected, yep, I am connected. But when I am not connected, I can spin in a loop waiting for a connection as long as I please, 30 seconds, a minute, more - still, not connected. I even tried to break down and reconnect wifi when it said I was not connected - waiting a luxurious 30 seconds for the reconnect to succeed - the result? Still not connection. I am really starting to think that there is something wrong with my handset. I certainly have no problem with transient disconnects and such resulting from moving from cell to cell, or from 3G to wifi, or edge to 3G - but I am sitting 3 feet from a very stable access point. On Nov 24, 8:13 pm, JP [EMAIL PROTECTED] wrote: I am working on an app with similar requirements and behavior. 15 seconds polling cycle to XML server. (User can set it, so user decides the level of load (;-)) I've had similar problems as you describe, and here's a couple of strategies I've employed successfully (i.e. surviving multiple test runs such as leaving WiFi coverage down office building elevator onto street level walk down into subway ride subway and back out onto street level with on-and-off 3G/Edge coverage, you get the idea...) - Check network status. Obviously there are no UDP/TCP connects possible when the device is not connected to a data network (zero bars). Check this through the status info from the NetworkInfo class. You need to request proper permission (android.permission.ACCESS_NETWORK_STATE). If not connected, I cycle through this twelve times on a one second interval. This is typically sufficient to wait for the completion of data network connections after the device wakes up. The device enters different levels of sleep, depending on the period of inactivity; you can see this in the DDMS log; things like DHCP release in Wifi mode, for example. So, after the device resumes, I give it up to twelve attempts to check data network connection status, take a break, and try again later, or if user triggers these twelve attempts. Provide UI feedback showing you're trying to connect. - Having established data network connectivity, you cannot assume a UDP/TCP (=URL) connect or read goes through. Either not at all, or things are just plain too slow (high latency) in comparison to the polling cycle. If the programmed URL timeouts extend beyond your polling cycle, you run into problems,. Which you are, because the standard timeouts are carry-overs from the dial-up Internets; you are looking at default timeouts in the 30s neighborhood. This means you need to set the connect and read timeouts of your network interactions to values below your polling cycle, and wrap everything in try/catch blocks. Again, provide user feedback if connections fail. The URL connect and read timeouts are set with java.net.URLConnection.setConnectTimeout(int) and .setReadTimeout (int). I've been experimenting with 4s to 8s. These strategies helped stabilize the action. I am under the impression that the data network/TCP stack connectivity gets confused if you try to connect at inopportune times (no data network connectivity) or while a connect/read is timing out, and then throw additional connection attempts at it. Hope this helps. On Nov 24, 5:17 am, joshv [EMAIL PROTECTED] wrote: I am attempting to write an application that regularly polls data from a publicly available website using a URLConnection. The code is pretty basic (urlStr contains the URL...) URL url = new URL(urlStr); URLConnection urlConn = url.openConnection(); urlConn.setConnectTimeout(5000); BufferedReader in = new BufferedReader(new InputStreamReader (urlConn.getInputStream())); String line; while ((line = in.readLine())!=null) { Anyway, even when the G1 is connected to the network (verified in browser) this block of code will regularly throw java.net.SocketException: No route to host, java.net.SocketTimeoutException: Socket is not connected (though this is probably because I added a timeout), and many times throw an Exception claiming that it could not resolve the hostname in urlStr - oddly the web browser has no such issues resolving the name. The above block of code runs every 10 seconds (or longer if the previous request takes longer), and I'd guess succeeds approximately 25-50% of the time, though it tends to be a bit streaky. When the connection succeeds, it take less than a second to connect and download the data, it's a very small data set - so the timeout setting should not be an issue. The periods of error do not correspond to a loss of connectivity, as I can browser the web at the same time the errors
[android-developers] Re: Flaky network connections
I can disclose the URL, it's publicly available and always up - yahoo finance csv stock price download. For example: http://finance.yahoo.com/d/quotes.csv?s=GOOG+Tf=sl1c1p2 It doesn't get much more highly available than this. I could test other URLs, but as I have mentionned before, the exact same code, with the exact same URL runs marvelously in the emulator, so I very much doubt it has anything to do with the URL. It's also not specific to wi-fi on the handset. I get the same behavior when I disable wi-fi and use only 3G. It would take me a bit of work to create a reproducible snippet, no proprietary concerns - just space. The code snippet I've already posted is simply running in another thread spawned by the UI thread. If I get some time I will try to work on a self-contained demo that reproduces the problem on my handset. On Nov 25, 7:02 am, Mark Murphy [EMAIL PROTECTED] wrote: joshvwrote: I am really starting to think that there is something wrong with my handset. I certainly have no problem with transient disconnects and such resulting from moving from cell to cell, or from 3G to wifi, or edge to 3G - but I am sitting 3 feet from a very stable access point. Here's my recommendation on how to proceed: First, create a separate really simple application that uses your current techniques (URLConnection or HTTPComponents) to access a Web site. Retrieve a Web page that is a no-brainer always-gonna-work-for-everyone page, particularly one that is OK for you to disclose. If this gives you the same symptoms as you're experiencing in your main application, post the manifest, layout, and activity source code, so some of us can try it and see if we get problems on our devices. If, however, this simplified example works just fine, start to slowly convert it to look more like what's giving you problems (e.g., switch to the actual Web page you're trying to hit instead), and see where the problems creep in. At the point when you start getting problems again, if your test code is still safe for public release (e.g., no proprietary information), post the manifest, layout, and activity source code, so some of us can try it out and see if we get the same problems. Going all the way back to your original post, the snippet of source you provided doesn't seem problematic (other than I'm a fan of HTTPComponents over URLConnection), but, then again, we aren't going to be able to reproduce your problem with just that snippet. In the end, if we collectively get a reproducible scenario that works, that sample code should serve us well on the issue tracker to make sure this gets looked at. -- Mark Murphy (a Commons Guy)http://commonsware.com Android Training on the Ranch! -- Mar 16-20, 2009http://www.bignerdranch.com/schedule.shtml --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Flaky network connections
I appear to have found the problem. The polling thread was starting in the constructor of a different class, and NOT from the UI thread. I changed the code to launch the polling thread from the main UI thread in the call to the Activity's onResume method - and it seems to be working quite well on the handset now. Why would this make a difference? No idea. I am assuming it's some subtlety of the security implementation with respect to threading. Perhaps the reason it worked on the emulator is that my handset and the emulator are at different release levels. On Nov 25, 8:12 am, JP [EMAIL PROTECTED] wrote: Not putting words in Mark's mouth but he meant to explain that you need to eliminate uncertainties; one being the site you try to access and if it's bomb proof as you describe; done. Next - you've got to isolate the problem. No way around it even though recreating the problem in a sandbox will cost you a couple of hours. Wireless comms is a tricky environment; the spiel of the different states of the underlying stack and their impact on your app are more complex than what you will find in the emulator. For test purposes, you definitely should reduce the complexity of your multi-threaded environment. The correct approach for the architecture of your app (perhaps more complicated than need be?), but a candidate to cause trouble if you do not fully understand the dynamics of the underlying communications stack (emulator vs. the real thing). On Nov 25, 5:43 am, joshv [EMAIL PROTECTED] wrote: I can disclose the URL, it's publicly available and always up - yahoo finance csv stock price download. For example:http://finance.yahoo.com/d/quotes.csv?s=GOOG+Tf=sl1c1p2 It doesn't get much more highly available than this. I could test other URLs, but as I have mentionned before, the exact same code, with the exact same URL runs marvelously in the emulator, so I very much doubt it has anything to do with the URL. It's also not specific to wi-fi on the handset. I get the same behavior when I disable wi-fi and use only 3G. It would take me a bit of work to create a reproducible snippet, no proprietary concerns - just space. The code snippet I've already posted is simply running in another thread spawned by the UI thread. If I get some time I will try to work on a self-contained demo that reproduces the problem on my handset. On Nov 25, 7:02 am, Mark Murphy [EMAIL PROTECTED] wrote: joshvwrote: I am really starting to think that there is something wrong with my handset. I certainly have no problem with transient disconnects and such resulting from moving from cell to cell, or from 3G to wifi, or edge to 3G - but I am sitting 3 feet from a very stable access point. Here's my recommendation on how to proceed: First, create a separate really simple application that uses your current techniques (URLConnection or HTTPComponents) to access a Web site. Retrieve a Web page that is a no-brainer always-gonna-work-for-everyone page, particularly one that is OK for you to disclose. If this gives you the same symptoms as you're experiencing in your main application, post the manifest, layout, and activity source code, so some of us can try it and see if we get problems on our devices. If, however, this simplified example works just fine, start to slowly convert it to look more like what's giving you problems (e.g., switch to the actual Web page you're trying to hit instead), and see where the problems creep in. At the point when you start getting problems again, if your test code is still safe for public release (e.g., no proprietary information), post the manifest, layout, and activity source code, so some of us can try it out and see if we get the same problems. Going all the way back to your original post, the snippet of source you provided doesn't seem problematic (other than I'm a fan of HTTPComponents over URLConnection), but, then again, we aren't going to be able to reproduce your problem with just that snippet. In the end, if we collectively get a reproducible scenario that works, that sample code should serve us well on the issue tracker to make sure this gets looked at. -- Mark Murphy (a Commons Guy)http://commonsware.com Android Training on the Ranch! -- Mar 16-20, 2009http://www.bignerdranch.com/schedule.shtml --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Flaky network connections
Tom, see upstream - it works fine for me now when I launch the polling thread from the UI thread. I was launching it from the constructor of another class, and for some reason this causes issues. It's quite reproducible. If I launch the polling thread from the UI thread it works. If I go back to launching it in the constructor it goes back to being very unreliable. I assume your example below is being called directly in the UI thread as you are updating UI objects directly. On Nov 25, 9:15 am, Tom Gibara [EMAIL PROTECTED] wrote: I just spent a minute knocking out a test case over a cup of tea. Seems to work fine for me on WIFI, GPRS, and 3G. Tom. void testConnection() { TextView view = (TextView) findViewById(R.id.message); HttpURLConnection conn = null; try { URL url = new URL(http://finance.yahoo.com/d/quotes.csv?s=GOOG+Tf=sl1c1p2;); conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod(GET); conn.connect(); Reader reader = new InputStreamReader( conn.getInputStream() ); StringWriter writer = new StringWriter(); for (int c = reader.read(); c = 0; c = reader.read()) writer.write(c); view.setText(writer.toString()); } catch (IOException e) { Log.e(test, connection test failed, e); } finally { if (conn != null) conn.disconnect(); } } 2008/11/25 joshv [EMAIL PROTECTED] I can disclose the URL, it's publicly available and always up - yahoo finance csv stock price download. For example: http://finance.yahoo.com/d/quotes.csv?s=GOOG+Tf=sl1c1p2 It doesn't get much more highly available than this. I could test other URLs, but as I have mentionned before, the exact same code, with the exact same URL runs marvelously in the emulator, so I very much doubt it has anything to do with the URL. It's also not specific to wi-fi on the handset. I get the same behavior when I disable wi-fi and use only 3G. It would take me a bit of work to create a reproducible snippet, no proprietary concerns - just space. The code snippet I've already posted is simply running in another thread spawned by the UI thread. If I get some time I will try to work on a self-contained demo that reproduces the problem on my handset. On Nov 25, 7:02 am, Mark Murphy [EMAIL PROTECTED] wrote: joshvwrote: I am really starting to think that there is something wrong with my handset. I certainly have no problem with transient disconnects and such resulting from moving from cell to cell, or from 3G to wifi, or edge to 3G - but I am sitting 3 feet from a very stable access point. Here's my recommendation on how to proceed: First, create a separate really simple application that uses your current techniques (URLConnection or HTTPComponents) to access a Web site. Retrieve a Web page that is a no-brainer always-gonna-work-for-everyone page, particularly one that is OK for you to disclose. If this gives you the same symptoms as you're experiencing in your main application, post the manifest, layout, and activity source code, so some of us can try it and see if we get problems on our devices. If, however, this simplified example works just fine, start to slowly convert it to look more like what's giving you problems (e.g., switch to the actual Web page you're trying to hit instead), and see where the problems creep in. At the point when you start getting problems again, if your test code is still safe for public release (e.g., no proprietary information), post the manifest, layout, and activity source code, so some of us can try it out and see if we get the same problems. Going all the way back to your original post, the snippet of source you provided doesn't seem problematic (other than I'm a fan of HTTPComponents over URLConnection), but, then again, we aren't going to be able to reproduce your problem with just that snippet. In the end, if we collectively get a reproducible scenario that works, that sample code should serve us well on the issue tracker to make sure this gets looked at. -- Mark Murphy (a Commons Guy)http://commonsware.com Android Training on the Ranch! -- Mar 16-20, 2009 http://www.bignerdranch.com/schedule.shtml --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Flaky network connections
I am attempting to write an application that regularly polls data from a publicly available website using a URLConnection. The code is pretty basic (urlStr contains the URL...) URL url = new URL(urlStr); URLConnection urlConn = url.openConnection(); urlConn.setConnectTimeout(5000); BufferedReader in = new BufferedReader(new InputStreamReader (urlConn.getInputStream())); String line; while ((line = in.readLine())!=null) { Anyway, even when the G1 is connected to the network (verified in browser) this block of code will regularly throw java.net.SocketException: No route to host, java.net.SocketTimeoutException: Socket is not connected (though this is probably because I added a timeout), and many times throw an Exception claiming that it could not resolve the hostname in urlStr - oddly the web browser has no such issues resolving the name. The above block of code runs every 10 seconds (or longer if the previous request takes longer), and I'd guess succeeds approximately 25-50% of the time, though it tends to be a bit streaky. When the connection succeeds, it take less than a second to connect and download the data, it's a very small data set - so the timeout setting should not be an issue. The periods of error do not correspond to a loss of connectivity, as I can browser the web at the same time the errors are happening. This happens whether connected to local wi-fi or 3G. Am I doing something wrong, or is network connectivity on the G1 just this flaky? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Flaky network connections
As I pointed out in my previous post, the polling occurs only when the application is active and on screen. It starts/stops in onResume/ onPause - so I am not sure how this is going to limit battery life unless the user forces the application to remain active for hours at a time. Could you please explain to me why, with a solid wi-fi signal and connection to a local access point, my URLConnections would ever throw an exception unless there is a problem with the remote website? Are the implementations of these APIs that brittle? Is the hardware really that flaky? Are there other APIs that bang on the hardware until it works, without throwing exceptions? Am I doing something wrong? Or is this level of unreliability, even over local wi-fi, to be expected? On Nov 24, 10:58 am, Jean-Baptiste Queru [EMAIL PROTECTED] wrote: Even with a 10-second pause between the end of a response and the next request, you're likely to keep the radio (either cell or wifi) turned on all the time, since they tend to stay up for about that long even when there's no activity before powering back down. That could limit the phone's battery life to as little as 3 or 4 hours (with the screen constantly off and the CPU idle most of the time). The APIs that you're using are built on top of a foundation that was designed for environments where the conditions that trigger exceptions were indeed more exceptional than what you're seeing on a device indeed. Such is the cost of making Android compatible with APIs that developers are likely to be familiar with. JBQ On Mon, Nov 24, 2008 at 8:51 AM, joshv [EMAIL PROTECTED] wrote: The polling happens only while the apps is loaded and displayed on screen. The second the screen turns off or another app is loaded, the polling stops. It's pretty well behaved in that respect. Also, I don't hammer the connection 6 times a minute no matter what - each thread waits for the previous to finish, waits ten seconds, and then attempts to connect. My issue is that URLConnections seem to be so unreliable that Exceptions seem to be the rule, not the exception. This might be something unique to my handset, I only have one, so I can't tell. It certainly doesn't happen in the emulator. I might expect it to happen if I have a marginal 3G or edge connection - but not when the handset is literally 3 feet away from the WiFi access point it's using for a connection. On Nov 24, 10:00 am, Andrew Stadler [EMAIL PROTECTED] wrote: If your code is going to access a site every 10 seconds, the radio is going to, essentially, stay on continuously. This is going to have a significant impact on your users' battery life. Is this definitely what you want to do? On Mon, Nov 24, 2008 at 5:17 AM, joshv [EMAIL PROTECTED] wrote: I am attempting to write an application that regularly polls data from a publicly available website using a URLConnection. The code is pretty basic (urlStr contains the URL...) URL url = new URL(urlStr); URLConnection urlConn = url.openConnection(); urlConn.setConnectTimeout(5000); BufferedReader in = new BufferedReader(new InputStreamReader (urlConn.getInputStream())); String line; while ((line = in.readLine())!=null) { Anyway, even when the G1 is connected to the network (verified in browser) this block of code will regularly throw java.net.SocketException: No route to host, java.net.SocketTimeoutException: Socket is not connected (though this is probably because I added a timeout), and many times throw an Exception claiming that it could not resolve the hostname in urlStr - oddly the web browser has no such issues resolving the name. The above block of code runs every 10 seconds (or longer if the previous request takes longer), and I'd guess succeeds approximately 25-50% of the time, though it tends to be a bit streaky. When the connection succeeds, it take less than a second to connect and download the data, it's a very small data set - so the timeout setting should not be an issue. The periods of error do not correspond to a loss of connectivity, as I can browser the web at the same time the errors are happening. This happens whether connected to local wi-fi or 3G. Am I doing something wrong, or is network connectivity on the G1 just this flaky? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Flaky network connections
I don't have any sniffing capabilities. The no route to host error would suggest that the attempt never leaves the phone, as the other devices on my network have no issues accessing the internet at the same time. This is by the way replicable on my access point at work, as well as at home, so it's not something in my access point - unless perhaps it's an issue with WPA. But I also see the same behavior when I have a strong 3G connection as well. On 3G I might expect a little bit of flakiness, though again, not 100% failure for minutes on end. On Nov 24, 2:01 pm, Dorn Hetzel [EMAIL PROTECTED] wrote: If you sniff the wire just past the wifi access point, how many requests/responses do you see during this time? On Mon, Nov 24, 2008 at 2:59 PM, joshv [EMAIL PROTECTED] wrote: My issues is that I am sitting 3 feet from a stable wi-fi access point and for minutes on end every single URLConnection attempt will fail. I could certainly understand if maybe the first attempt failed, or took longer, because I was waiting for the radio to turn on, but 100% failure for minutes on end is just weird. There is no good reason for it. It should be considered a bug. And even when it does work, it's still not 100%, the failure rate is still very high. This makes for a really crappy application experience, as I simply cannot predict when my user will see their data update. I feel like there are reliable ways of communicating, as even when my application is experiencing errors, I get emails and IMs on the phone, and I can browse the internet - so somehow the google apps are able to communicate. That's why I am asking if I am doing something wrong or if there is some other API I should try. I can try out the Apache HTTPComponents, but I am assuming they just wrap the lower level java network APIs. I am not sure what benefit I would get. On Nov 24, 1:44 pm, Tom Gibara [EMAIL PROTECTED] wrote: I don't know if this is related to what you're experiencing, but it's my understanding that the wifi connections shuts down when the phone sleeps. I believe this is because, unlike the radio, it requires the CPU to be active to maintain the connection. Also, contrary to your view, I think it's not intrinsically a hardware or software problem. It's simply that in the context of mobile phone software, the probability of a connection failure is greater than that you may be used to, and due to the necessary limitations in powering the device, simple solutions (like constantly striving to maintain a wifi connection) aren't an option. Perhaps a better perspective is to see the various data connections (wifi, GPRS, EDGE, 3G etc.) as fallible primitives which you can combine to form a more reliable transport suited to your application's needs. Tom. 2008/11/24 joshv [EMAIL PROTECTED] As I pointed out in my previous post, the polling occurs only when the application is active and on screen. It starts/stops in onResume/ onPause - so I am not sure how this is going to limit battery life unless the user forces the application to remain active for hours at a time. Could you please explain to me why, with a solid wi-fi signal and connection to a local access point, my URLConnections would ever throw an exception unless there is a problem with the remote website? Are the implementations of these APIs that brittle? Is the hardware really that flaky? Are there other APIs that bang on the hardware until it works, without throwing exceptions? Am I doing something wrong? Or is this level of unreliability, even over local wi-fi, to be expected? On Nov 24, 10:58 am, Jean-Baptiste Queru [EMAIL PROTECTED] wrote: Even with a 10-second pause between the end of a response and the next request, you're likely to keep the radio (either cell or wifi) turned on all the time, since they tend to stay up for about that long even when there's no activity before powering back down. That could limit the phone's battery life to as little as 3 or 4 hours (with the screen constantly off and the CPU idle most of the time). The APIs that you're using are built on top of a foundation that was designed for environments where the conditions that trigger exceptions were indeed more exceptional than what you're seeing on a device indeed. Such is the cost of making Android compatible with APIs that developers are likely to be familiar with. JBQ On Mon, Nov 24, 2008 at 8:51 AM, joshv [EMAIL PROTECTED] wrote: The polling happens only while the apps is loaded and displayed on screen. The second the screen turns off or another app is loaded, the polling stops. It's pretty well behaved in that respect. Also, I don't hammer the connection 6 times a minute no matter what - each thread waits for the previous to finish, waits ten seconds, and then attempts
[android-developers] Re: Flaky network connections
I am assuming that HTTPComponents just wraps the underlying java networking APIs - but perhaps I am wrong and they wrote an HTTP client all the way down to the socket level. Regardless, it can't hurt to try. In generally I have absolutely no problems using URLConnection. The code I've written works marvelously in the emulator, and I have other non-Android projects that use URLConnection, so I am not exactly sure what's wrong. On Nov 24, 2:10 pm, Mark Murphy [EMAIL PROTECTED] wrote: joshv wrote: That's why I am asking if I am doing something wrong or if there is some other API I should try. I can try out the Apache HTTPComponents, but I am assuming they just wrap the lower level java network APIs. I am not sure what benefit I would get. You want to find out if there is some other API [you] should try, but then you don't want to try it because you are not sure what benefit [you] would get? I can tell you that URLConnection gave me tons of grief on Java SE and I abandoned it ages ago in favor HTTPComponents (originally called HTTPClient). I can tell you that I have not experienced any of the problems you describe when using HTTPComponents on Android, though I have mostly been using WiFi due to weak T-Mo signal strength and no 3G in my work area. -- Mark Murphy (a Commons Guy)http://commonsware.com Android Training on the Ranch! -- Mar 16-20, 2009http://www.bignerdranch.com/schedule.shtml --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Flaky network connections
It's identical code - identical URL, no SSL, using a domain name. In the emulator I very rarely get a socket timeout - but that's because I've set a pretty aggressive 5 second timeout - which periodically the target website (or our intervening network path) fails to meet - this is to be expected, but other than that it never errors out in the emulator. If it worked this well on the actually phone I'd be perfectly happy. -josh On Nov 24, 2:53 pm, Mark Murphy [EMAIL PROTECTED] wrote: joshv wrote: I am assuming that HTTPComponents just wraps the underlying java networking APIs - but perhaps I am wrong and they wrote an HTTP client all the way down to the socket level. Regardless, it can't hurt to try. I suspect it's written to Java sockets. The code I've written works marvelously in the emulator Now *that's* odd. Is there anything unusual about the URL you are trying to connect to: SSL? Oddball port? IP address instead of domain name? The server you're trying to hit is on the same PC as the emulator you were running? -- Mark Murphy (a Commons Guy)http://commonsware.com Android Training on the Ranch! -- Mar 16-20, 2009http://www.bignerdranch.com/schedule.shtml --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Flaky network connections
Proxied via t-mobile even when I am using my own wi-fi network? On Nov 24, 3:29 pm, Tom Gibara [EMAIL PROTECTED] wrote: From the phone, connections will almost certainly be proxied by T-mobile. Perhaps it's the interaction between your server and the proxies that is at the root of your problem? Tom. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: unable to see # in webview
Use WebView.loadDataWithBaseURL, use dummy for the base URL if your HTML is locally generated. WebView.loadData, for some bizarre reason, munges the entire HTML document into a URL using the data: scheme. The url encoded clobbers %'s and #'s. On Nov 15, 1:29 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have the similar problem with % (#37). On Nov 15, 1:00 pm, sori [EMAIL PROTECTED] wrote: I have the same problem and cannot find a solution. Any help? -sori On Nov 6, 7:47 am, vel [EMAIL PROTECTED] wrote: finalWebViewwv = (WebView) findViewById(R.id.msgs); wv.loadData( bodyB#35;/B/body, text/html, utf-8); nothing is displayed in thewebviewand once we try to load a #characterother characters following it are also not displayed Pls any one can guide me why this weired behavior Regards Vel- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: '%' problem in WebView
Use WebView.loadDataWithBaseURL. On Nov 15, 11:07 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: My HTML file contains '%'. I was trying to use WebView to open it, but failed. I then replaced % with \\%, it failed again. Any comments on this problem. 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Inaccurate comment view in Market?
I see this as well with my application (Touch Tip). The Android Market is extremely buggy at the moment. It seems that not much attention is being paid to it as it appears to be getting worse, not better. One would think that this would be a little bit more important to Google. Android is is a flagship product, and the new user's first experience trying to download new apps is likely to be pretty broken. It doesn't leave a good impression of the platform. On Nov 13, 11:00 am, Nick Melnick [EMAIL PROTECTED] wrote: I have one application (ElJay) in the Market that has gone through a few version upgrades since it was originally posted. I noticed that Google has merged all of the ratings and comments for the application, which is rather neat, but the dates are wildly inaccurate. Comments from the first couple of revisions, where the application was admittely rough, are being shown on first view of the application under today's or yesterday's date, leading people to believe that the application is fundamentally flawed. Will this be fixed, or is this only happening for my application? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: working WebView example?
Try putting the WebView in your layout, assigning it an appropriate ID, and then in onCreate get a reference to it using: setContentView(R.layout.webtest); //Or whatever the name of your layout containing the webview is. WebView wv = (WebView)findViewById(R.id.webViewID); This works for me. -josh On Nov 17, 3:36 pm, benadamx [EMAIL PROTECTED] wrote: yey folks, wondering if anyone can provide a quick WebView example that successfully loads a page from the interweb; most of the examples I've found either contain code that isn't valid againt the latest version of the SDK, or that just outright doesn't work. here's what I have so far: public class SuperDoodad extends Activity { public void onCreate(Bundle icicle) { super.onCreate(icicle); WebView webview = new WebView(this); webview.loadUrl(http://www.stumbleupon.com;); setContentView(webview); } } .. this builds and runs fine, but fails to load the page, giving me a 'Web page not available' error. I have granted this app Internet permissions; what am I missing? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: JavaMail and Android - Little excursus
I am not sure why they would need to contact you. They'd need to merely obey the CDDL - which also requires you to provide the source code to your modifications. Where can I find the modified source? On Nov 14, 5:26 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Licence was update. Moved to CDDL. This library is not free to use. Please contact me in case in case of commercial uses. On 9 Ott, 13:00, Mos Alexandru [EMAIL PROTECTED] wrote: This .jar package realy works for sending mails. 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Mouse Gesture for Navigation?
Actually I've found the following works well: @Override public boolean dispatchTouchEvent(MotionEvent ev){ gd.onTouchEvent(ev); return super.dispatchTouchEvent(ev); } calling super.dispatchTouchEvent allows all of the other views to receive their events. For some reason, in my layouts, onTouch is never called for the Activity, so this is the only way I've found to detect gestures on the Activity. On Nov 3, 4:07 pm, Rohit Mordani [EMAIL PROTECTED] wrote: yi, doing that will disable all normal touch event dispatching for that view and any of its children. It's really rare that you should override a dispatch method, especially doing so and never calling through to the super class. The correct thing is almost always to override onTouchEvent(). Rohit On Oct 31, 1:05 pm, Rohit Mordani [EMAIL PROTECTED] wrote: In addition you need to do the following in your view: @Override public boolean dispatchTouchEvent(MotionEvent ev){ return mGestureDetector.onTouchEvent(ev); } Thanks Rohit On Oct 31, 2:01 pm, Rohit Mordani [EMAIL PROTECTED] wrote: I got fling/swipe to work. In one of my other posts someone told me to do the following to make the onFling and Scroll methods to be called: 1) Set View.setLongClickable to true for the view you are using 2) Set GestureHandler.setIsLongpressEnabled to true 3) Return true in your onDown method Thanks for all the help Rohit On Oct 30, 5:12 pm, Romain Guy [EMAIL PROTECTED] wrote: A fling is just an ACTION_DOWN, one or more ACTION_MOVE and an ACTION_UP. It has nothing to do with running in the emulator or not. (For what it's worth, a large part of the touch UI and APIs have been developed in the emulator.) On Thu, Oct 30, 2008 at 4:18 PM, Rohit Mordani [EMAIL PROTECTED] wrote: I THINK the problem is that in the emulator, pressing the left mouse button is more like a tap and that sets the MotionEvent.Action to be ACTION_DOWN. As a result the onDown() method of the OnGestureListener is called instead of onFling(). There might be a way to emulate the fling in the emulator but I am not sure of it. If anyone finds out then please let me know. That would then call onFling() correctly I think Rohit On Sep 22, 6:40 am, kingtut [EMAIL PROTECTED] wrote: Any luck in getting the onFling or onScroll event to fire? I am facing the same problem. On Sep 12, 5:14 pm, Mark Hansen [EMAIL PROTECTED] wrote: Ok, I'll keep trying it.. for some reason the events aren't firing such as Fling etc. On Sep 12, 10:12 am, Kavi [EMAIL PROTECTED] wrote: ListView is a kind of View, so you should be able to attach the GestureDetector to your ListView as well. -- Romain Guywww.curious-creature.org --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---