[android-developers] Re: (unofficial) Bluetooth API v. 0.2
Nick has posted about this fairly regularly either on android-platform or android-porting. On Mon, Sep 28, 2009 at 4:50 AM, jdesbonnet wrote: > > Dianne, > > Is there any chance you or someone else on the Android project can > make a statement (if even a vague one) about the Bluetooth API plans > and timeline. You can see from the issue tracker (http:// > code.google.com/p/android/issues/detail?id=1725) that there is much > wailing and gnashing of teeth over this issue > > Keep up the great work on Android: I'm really looking forward to the > Bluetooth API (I have great plans for an app which requires bluetooth > which is why I'm anxious to know). > > Best regards, > > Joe. > > > On Sep 16, 9:06 pm, windstorm wrote: > > Agree with Jonas. We are not trying to break Android's rule but, > > sometimes we have to play with things or tricks or whatsoever for > > keeping on using Google's phone which rocks but with suckingBluetooth. > Otherwise we have to change the platform, which is the last > > thing I wanna see. > > > > On Sep 16, 1:04 pm, "Jonas Petersson" wrote: > > > > > > > > > Dianne Hackborn wrote: > > > > Again, this code is using PRIVATE APIs. As we've said repeatedly, > doing > > > > so is not safe, and you can expect your code to break in various ways > as > > > > a result.[...] > > > > > Thank you, Dianne. I'm pretty sure that everyone involved in these two > > >Bluetoothprojects are very much aware of this and try to make it clear > > > to the potential users too. > > > > > As I see it, the choice is between having basically no usefulBluetooth > > > API and to "boldy go where no man has gone before"... > > > > > Presumably, the main reason for changing that private API would be to > > > make a fully working public API. If (when) that happens everyone will > be > > > happy. Until then, it should be reasonably safe to examine the build > > > number (and hw id etc) and see what can be done by hitting the metal, > right? > > > > > Best / Jonas > > > -- 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, and so won't reply to such e-mails. 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: Anyone used performHapticFeedback()?
Currently there is only a definition for long press, so this API isn't all that useful. (This is also why the preference is hidden away in SpareParts, it's not really ready for prime time.) If you are giving feedback for a long press, then you may want to use it... but if you also feel the need to have it ignore the preference, then please consider having your own preference in your app since some users really dislike this stuff. On Mon, Sep 28, 2009 at 8:44 AM, Lee wrote: > > This one works for me: > > performHapticFeedback( HapticFeedbackConstants.LONG_PRESS, > HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING ); > > I remember having trouble getting other things to work. > > Fortunately I only use Haptic Feedback with a long press, otherwise > the Code Cops might come calling. > > If really want to be hauled in front of a judge you can use the > Vibrator service directly. > > Lee > > On Sep 28, 2:33 pm, James W wrote: > > I want to invoke the haptic feedback buzz when my ImageButton is > > pressed, but I am not sure the best way to do it. I first checked that > > my button was enabled for that, and isHapticFeedbackEnabled() returns > > true. > > > > Then I am calling performHapticFeedback() with the constant > > FLAG_IGNORE_GLOBAL_SETTING, as the docs indicate that will be used to > > override any global settings. > > > > The doc is a little ambiguous, but it does imply that this is > > something I can call at any time, so I am calling it in the > > OnClickListener(): > > > > final ImageButton mybutton= (ImageButton) findViewById > > (R.id.mybutton); > > mybutton.setOnClickListener(new View.OnClickListener() > > { > > public void onClick(View v) > > { > > mybutton.performHapticFeedback > > (HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); > > // The rest of my code > > } > > } > > ); > > > > I appreciate that it would be better to call it when the finger first > > touches the button rather than on the Click event, but I wanted to get > > it working to start with, before refining it. > > > > Am I barking completely up the wrong tree, or should the above work > > when I click on the button, because nothing happens? > > > -- 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, and so won't reply to such e-mails. 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: Launch Activity Call without screen change
No, it is not possible, nor is it desirable -- the in-call screen does a lot of special stuff to provide a UI that works well when you are actually talking on the phone (not being impacted by false touches and such). On Mon, Sep 28, 2009 at 7:18 AM, fritzZz wrote: > > It is possibile to start an outcoming call without change screen? I've > a widget that perform a call for get remaining credit, but I don't > want to change screen... > If this isn't possibile, is possibile to return to the home screen > when the call is terminated? Now the screen remain on last call log. > > Thank you > > > -- 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, and so won't reply to such e-mails. 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 1.5 and 1.6 versions of SDK sitting side by side...
I have 1.1, 1.5 and 1.6 all peacefully coexisting on my dev boxes. Follow the directions. mike --~--~-~--~~~---~--~~ 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: Trouble in Printing Unicode Male Character
We have confirmed that the current shape for U+2642 in Droid Sans Fallback is a bug. This will be corrected in the font and supplied for a future release of Android. In the meantime, if you need a correct shape for that character, you could obtain (e.g. purchase/license or create) a font that has the correct form and use that as a private font (use Typeface.createFromAsset in your app). Josh --~--~-~--~~~---~--~~ 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 write SharedPreferences after update!! Help!
Hello, I'm trying to prepare an update to one of my apps and I just realized that the updated version cannot read or write over the previous version's SharedPreferences. Some details: * I'm using the 1.6 SDK and compiling for 1.5.3. * My androidmanifest.xml does not have a sharedUserId (I didn't think I need one if I was not sharing data between different apps). How to reproduce: * Install my current app from the market * Run the app * Exit and save the setting - invoking SharedPreferences Editor commit (it's using MODE_PRIVATE) * Now install my new update (via a browser download) * Run the app * Everything works fine * Exit & Save *** Now reboot the phone * Run the app again ==> Can no longer access old data or write over it!! Did I do something wrong? Is it because of the sharedUserId thing? Is it because of the way I'm testing - via market then browser? Why is LogCat reporting a UID change? ==> mismatched uid: 10031 on disk, 10046 in settings; Can I recover from this? I don't want to delete all of my users' data. help! =] Here's some edited output from LogCat: 09-28 09:10:54.083: ERROR/PackageManager(60): Package com.my.application.package.path has mismatched uid: 10031 on disk, 10046 in settings; read messages: 09-28 09:10:54.083: ERROR/PackageManager(60): Read completed successfully: 71 packages, 7 shared uids 09-28 09:11:08.513: ERROR/ApplicationContext(60): Couldn't create directory for SharedPreferences file shared_prefs/wallpaper-hints.xml 09-28 09:11:51.522: ERROR/ApplicationContext(278): Couldn't rename file /data/data/com.my.application.package.path/shared_prefs/ MyFuzzleFile.xml to backup file /data/data/ com.my.application.package.path/shared_prefs/MyFuzzleFile.xml.bak 09-28 09:11:51.552: ERROR/ApplicationContext(278): Couldn't create directory for SharedPreferences file /data/data/ com.my.application.package.path/shared_prefs/MyFuzzleFile.xml 09-28 09:11:51.552: ERROR/ApplicationContext(278): Couldn't rename file /data/data/com.my.application.package.path/shared_prefs/ MyFuzzleFile.xml to backup file /data/data/ com.my.application.package.path/shared_prefs/MyFuzzleFile.xml.bak 09-28 09:11:51.552: ERROR/ApplicationContext(278): Couldn't create directory for SharedPreferences file /data/data/ com.my.application.package.path/shared_prefs/MyFuzzleFile.xml Thank You! Any help is appreciated! Chad --~--~-~--~~~---~--~~ 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: ADC2: Low volume of judges
I think there is a huge number of apps submitted in this contest and sorting out the best is a huge work... that for once has been given to the users ! This is a great opportunity for us, but it also shows us that every app developer can't be the best. The notes we have to give to apps are quite clear about what a winner could be : - it has to be an original concept - it has to use the specific features of the android platforms - it has to look good - it has to be universally useful to all of the reviewers Based on this, it's quite natural that applications that are not working right, are too specifically oriented to a subset of the population (religion, geography) will get eliminated on first round. If most of reviewers skip 80% of the submitted apps, this is because they, from the beginning, would not get a good mark on the "utility" line. I have really tested maybe a dozen apps for the moment, and most of them did not reach more than 2 stars in every line, because they are not working, are one version of a concept among a hundred similar implementations, or because they don't answer MY needs. This is true for every other revewers, and it has to be like this if we really want to see emerging the real best apps. There is no place for poor apps, this is a contest for really outstanding apps that will show all the power of the android platform against the others. So, even if after this round only a dozen of apps get high rates, I think these apps will really be the ones that will deserve it and it's allright ! It might be sad for developers who spent a lot of time in coding their apps and do not get many reviews, but... hey, wake up ! this means your app is either not good enough or too specific (and this does not mean it is bad !). On 28 sep, 16:47, Disconnect wrote: > If it doesn't work, it gets rated low. If it takes hours to set itself > up (I'm looking at you local-radio-cache-app) it gets given up on and > rated low. (Hours of downloads, on a link that can pull an entire > ubuntu dvd in a few minutes..) Any app that goes all FC after the > first page (ahem, awesome-looking monster card game list) gets low > ratings.. > > I think the biggest two problems with the -number- of reviewers is > that getting an app to actually install is a mess (I have only had one > install via ADP app, and one that wouldn't install at -all- after > trying half the weekend) and not that many people know it is there to > begin with.. > > On Mon, Sep 28, 2009 at 12:21 AM, Rud wrote: > > > I agree. I wish the judging app allowed something like 5 apps to be > > queued on the phone. There are some I skipped because I didn't have > > time to explore them right now but did want to see what else is being > > offered. I'm hoping some of the skipped ones will reappear at some > > point. > > > Rud > > > On Sep 27, 9:03 pm, "Maps.Huge.Info (Maps API Guru)" > > wrote: > >> > I wonder how many of the users judging the applications have submitted > >> > their own applications and are just voting other applications down to > >> > improve their own chances of winning... > > >> That's a rather cynical view, however, one that's probably close to > >> the mark in a lot of cases. > > >> I've been testing apps since the judging began and frankly, the > >> judging app is slanted toward apps that can produce the desired result > >> with little or no user interaction or understanding of what the app > >> does. If you require the user to actually understand what you're > >> offering, with registration and other details, you're in for a bad > >> time in ADC2. I think it was probably less than ideal that the judging > >> app can only work one article at a time. It might have been more fair > >> and even if it could have held a universe of apps the user would like > >> to try out. > > >> -John Coryat > > >> "Radar Now!" > > >> "What Zip 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] Re: Can't i call a service function in activity's onStart/onCreate?
You need to wait until you actually receive the service connection callback before you do anything with the service. You can't simply assume that the callback has already happened when you reach your onStart. On Mon, Sep 28, 2009 at 7:36 AM, bear tung wrote: > My activity bind a service. I want to call the service's function in > actitity's onStart/onCreate function, but it doesn't work. > The service started suncess but the connection is null. > > When I just call the service's function in other function (onClick for > example), it works well. > > thanks for help. > > here is my code: > > public class AidlTest extends Activity > { > private static final String TAG = "AidlTest"; > IAidlService mService; > > private OnClickListener mCorkyListener = new OnClickListener() { > public void onClick(View v) { > test(); > } > }; > > private ServiceConnection mConnection = new ServiceConnection() { > > public void onServiceConnected(ComponentName className, IBinder > service) { > mService = IAidlService.Stub.asInterface(service); > } > public void onServiceDisconnected(ComponentName className) { > > mService = null; > } > }; > > @Override > public void onCreate(Bundle savedInstanceState) > { > super.onCreate(savedInstanceState); > TextView v = new TextView(this); > setContentView(v); > v.setOnClickListener(mCorkyListener); > Log.v(TAG, IAidlService.class.getName().toString()); > Intent intent = new Intent(IAidlService.class.getName()); > bindService(intent, mConnection, Context.BIND_AUTO_CREATE); > } > > @Override > public void onStart(){ > super.onStart(); > Log.d(TAG, "onStart"); > test(); > } > } > > public void test(){ > if (mService == null){ > Log.d(TAG, "mService is NULL"); > } > try { > mService.test(); > }catch (RemoteException e){ > Log.d(TAG, e.toString()); > } > } > } > > > > Bear > > > > --~--~-~--~~~---~--~~ 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: Anyone used performHapticFeedback()?
This one works for me: performHapticFeedback( HapticFeedbackConstants.LONG_PRESS, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING ); I remember having trouble getting other things to work. Fortunately I only use Haptic Feedback with a long press, otherwise the Code Cops might come calling. If really want to be hauled in front of a judge you can use the Vibrator service directly. Lee On Sep 28, 2:33 pm, James W wrote: > I want to invoke the haptic feedback buzz when my ImageButton is > pressed, but I am not sure the best way to do it. I first checked that > my button was enabled for that, and isHapticFeedbackEnabled() returns > true. > > Then I am calling performHapticFeedback() with the constant > FLAG_IGNORE_GLOBAL_SETTING, as the docs indicate that will be used to > override any global settings. > > The doc is a little ambiguous, but it does imply that this is > something I can call at any time, so I am calling it in the > OnClickListener(): > > final ImageButton mybutton= (ImageButton) findViewById > (R.id.mybutton); > mybutton.setOnClickListener(new View.OnClickListener() > { > public void onClick(View v) > { > mybutton.performHapticFeedback > (HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); > // The rest of my code > } > } > ); > > I appreciate that it would be better to call it when the finger first > touches the button rather than on the Click event, but I wanted to get > it working to start with, before refining it. > > Am I barking completely up the wrong tree, or should the above work > when I click on the button, because nothing happens? --~--~-~--~~~---~--~~ 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: Crossword Puzzle in Android
I just put a tutorial up on making tiles scale correctly. Its not exactly what you are doing but theres enough overlap to get you going. http://www.androidacademy.com/3-tutorials/43-hands-on/154-device-independent-display-scaling -- http://www.androidacademy.com On Sep 28, 1:05 pm, Kwan Toh Choong wrote: > Hi All, > > Thanks for the advice from everyone. I've done a little bit of research, but > I m not sure the idea of rendering the boxes with numbering is correct or > not. > Is it true that I can draw on a canvas? I m reading this > tutorialhttp://www.anddev.org/the_pizza_timer_-_threading-drawing_on_canvas-t... > > It seems like after I draw a box, I can still draw on the same place, > overlapping it. So I can do something like "drawing" the numbers on top of > the boxes right? > > In face I'm not doing a crossword. It looks similar to crossword but it is > called CodeCracker instead. I did a google on "CodeCracker" but the result > it returns are mostly something else. Here are a few link on the > "CodeCracker" I m saying: > > http://www.codecracker.co.nz/samples/samples.htmhttp://www.puzzco.com/knight%20features/interactive/samples/Interacti...http://www.thepuzzlecompany.co.nz/samples/Interactive%20Samples/code-... > > Regards > Kwan > > > > On Mon, Sep 28, 2009 at 2:00 PM, Seth Mould wrote: > > > Hi Kwan, > > > I have a project on SourceForge called xW which seeks to establish a > > standard XML format for word puzzles, so you might want to look at > > that for your input. Try looking for open Sudoku projects -- there is > > more interest in Sudoku than crosswords and the rendering of cells is > > the same except for numbering. > > > Please remember that advanced UK crosswords use bars instead of black > > squares, so a typical bitwise enumeration for the cell's appearance > > will be 0 - Blank, 1 - Black, 2 - Left bar, 4 - Top bar. > > > I haven't got round to writing a generic renderer for Android but when > > I do it will be Open. Regards Seth --~--~-~--~~~---~--~~ 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.5 and 1.6 versions of SDK sitting side by side...
have not heard anything about this, anyone? anyone? On Sep 25, 9:27 am, sdphil wrote: > i read the migration notes for 1.6 and I could not tell if 1.5 and 1.6 > can co-existsidebyside. > > i need to build applications for both 1.5 and 1.6, and i only have one > build machine. > > other than changing my PATH variable, are there any other gotchas? > especially for an automated build process which will need to build > images for both platforms. > > also, i am a bit concerned about updating the ADT plugin. if I do > that (update the ADT plugin), will that screw up my development on/for > 1.5? > > tia. --~--~-~--~~~---~--~~ 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: Updating ADC2 entry in second round
http://lmgtfy.com/?q=adc2+terms+and+conditions Especially: 9. SECOND ROUND JUDGING a. ENTRIES: Second Round Judging is only for entries selected as Qualifying Entries in the First Round Judging. The same application submitted by these Participants for the First Round will be distributed for judging in the Second Round. There is no opportunity to improve or modify an application between the First and Second Rounds of Judging. --~--~-~--~~~---~--~~ 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: Updating ADC2 entry in second round
Thanks for the answer. Are you associated with Google so I can count this as an official statement, or where do you take this information from? Thanks, Chris On 27 Sep., 18:07, Agus wrote: > no > > On Sun, Sep 27, 2009 at 9:04 AM, Chris wrote: > > > Hi, > > > is there a possbility to update ones ADC2 entry in case it gets into > > the second round? I e.g. found a stupid bug that I would like fixed if > > the app gets further into ADC2 second round. > > > Thanks, > > Chris > > -- > > SomaView - Augmented reality for Android that just works! --~--~-~--~~~---~--~~ 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: ADC2: Low volume of judges
If it doesn't work, it gets rated low. If it takes hours to set itself up (I'm looking at you local-radio-cache-app) it gets given up on and rated low. (Hours of downloads, on a link that can pull an entire ubuntu dvd in a few minutes..) Any app that goes all FC after the first page (ahem, awesome-looking monster card game list) gets low ratings.. I think the biggest two problems with the -number- of reviewers is that getting an app to actually install is a mess (I have only had one install via ADP app, and one that wouldn't install at -all- after trying half the weekend) and not that many people know it is there to begin with.. On Mon, Sep 28, 2009 at 12:21 AM, Rud wrote: > > I agree. I wish the judging app allowed something like 5 apps to be > queued on the phone. There are some I skipped because I didn't have > time to explore them right now but did want to see what else is being > offered. I'm hoping some of the skipped ones will reappear at some > point. > > Rud > > > On Sep 27, 9:03 pm, "Maps.Huge.Info (Maps API Guru)" > wrote: >> > I wonder how many of the users judging the applications have submitted >> > their own applications and are just voting other applications down to >> > improve their own chances of winning... >> >> That's a rather cynical view, however, one that's probably close to >> the mark in a lot of cases. >> >> I've been testing apps since the judging began and frankly, the >> judging app is slanted toward apps that can produce the desired result >> with little or no user interaction or understanding of what the app >> does. If you require the user to actually understand what you're >> offering, with registration and other details, you're in for a bad >> time in ADC2. I think it was probably less than ideal that the judging >> app can only work one article at a time. It might have been more fair >> and even if it could have held a universe of apps the user would like >> to try out. >> >> -John Coryat >> >> "Radar Now!" >> >> "What Zip 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] Wondering if someone can clarify this android 2.0 and 1.6
There was a talk some months ago that Android 2.0 is donut. However I see that 1.6 is just out and it indeed is "donut". Can someone clarify what Android 2.0 is then and how soon befor it hit the ropes? Thanks Satya --~--~-~--~~~---~--~~ 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] Intent for the Alarm Clock application
Is there a public intent for the Alarm Clock application that can be used for listening on Alarms going off? I.e. an intent that allows some additional action to be performed. --~--~-~--~~~---~--~~ 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: Intent.putExtra (String name, String[] value) caching old value
Okay I found out what was happening. It was actually two things: 1) Was not editing the data used inside a PendingIntent. Changing the flag in the PendingIntent.getService(...) method to FLAG_UPDATE_CURRENT solved this. However this led to the second problem. 2) A new PendingIntent is not always created with each call to PendingIntent.getService(...). If the arguments to that call match then the method will return an existing PendingIntent that matches to be used. I think Android is trying to be smart about reusing resources. The only argument the method doesn't check when deciding to reuse an existing PendingIntent, or provide a new one, is the Intent itself. This posed a problem for me, because my activity needed to send multiple PendingIntents, each using an Intent with the same Class but different extended data for the Intent. All of the PendingIntents needed to be active at the same time. For example, one PendingIntent needed to go off 8 minutes from now, while another PendingIntent needed to go off 10 min from now. If the first PendingIntent was already sent to the AlarmManager, once I tried to make a new PendingIntent for the 10 min delay, it would grab the Existing PendingIntent, and change it instead, essentially now only providing one Active PendingIntent. Unfortunately as of right now there are no flags you can pass to a PendingIntent that will force the method to provide a brand-new Pending Intent, i.e. don't try to match the arguments to an existing one and return that one. However I found a "hack" solution right now. The int requestCode parameter used in the PendingIntent.getService(..) is not used right now according to the documentation, however, it is still checked by the method to decide if there is a matching already existing PendingIntent out there. So my hack solution is to just provide a new dummy requestCode every time I call the PendingIntent.getService(...), which creates a mismatch in parameters, it doesn't find an existing PendingIntent with that requestCode, and gives me a new one. My app is now doing exactly what I want. This is a hack though, because if the requestCode is ever used in the future, this might mess things up. I propose that in the future the PendingIntent.getService(...) method should have a flag that forces a new pending intent to be created, e.g. FLAG_CREATE_NEW. The FLAG_ONE_SHOT doesn't quite do this, since if the first PendingIntent hasn't actually been used yet, and you try to create another one to be used later, it will match and grab the first and modify it, effectively getting rid of the first logical PendingIntent that would have been used. Jason On Sep 26, 6:59 pm, "Jason B." wrote: > Thanks Lee. I'll give that a shot and post the results. > > On Sep 26, 5:14 am, Lee wrote: > > > Try using setData() to store your message instead of extras: that > > forces the Intent to be seen as a new one. Or you can keep using > > extras and > > create some other unique token every time for setData(). > > > Lee > > > p.s. also see the flags you can use at the end of the getService call > > (read > > the PendingIntent docs). There's something like > > 'FLAG_REPLACE_CURRENT'. > > > On Sep 25, 9:39 pm, "Jason B." wrote: > > > > Hi, > > > > I'm creating an intent that I'm pushing to the AlarmManager so that a > > > service will be run at a later time. I have a single string value I > > > need to pass with the intent so the service knows what to "do" when > > > it's onStart() is called. > > > > Here is the code that sets up my intent and pushes it to the > > > AlarmManager > > > > Intent myintent = new Intent(); > > > myintent.setClass(mContext, RemindMeLater_Service.class); > > > myintent.putExtra("ReminderText", mEditText_Reminder.getText().toString > > > ()); > > > mPendingIntent = PendingIntent.getService(this, 0, myintent, 0); > > > > // Use the AlarmManager to schedule the PendingIntent > > > mAlarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, alarmTime, > > > mPendingIntent); > > > > Notice the line: > > > > myintent.putExtra("ReminderText", mEditText_Reminder.getText().toString > > > ()); > > > > Essentially I'm trying to "change" the extended data referenced by the > > > same name in the putExtra call. Note also that the "myintent" Intent > > > is freshly created everytime this block of code executes, so it should > > > be a new instantiated Intent object. The text that is put into the > > > extended data comes from an EditText view on my activity. > > > > The code in the service that is trying to pull the string out is: > > > > public void onStart(Intent intent, int startId) { > > > > // Increment mReminderId to ensure each notification is unique to > > > this context > > > String reminderText = intent.getStringExtra("ReminderText"); > > > > //do stuff with the "reminderText" we just got out of the intent > > > // ... > > > } > > > > Seems pretty simple, and logical. So here comes the p
[android-developers] Can't i call a service function in activity's onStart/onCreate?
My activity bind a service. I want to call the service's function in actitity's onStart/onCreate function, but it doesn't work. The service started suncess but the connection is null. When I just call the service's function in other function (onClick for example), it works well. thanks for help. here is my code: public class AidlTest extends Activity { private static final String TAG = "AidlTest"; IAidlService mService; private OnClickListener mCorkyListener = new OnClickListener() { public void onClick(View v) { test(); } }; private ServiceConnection mConnection = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder service) { mService = IAidlService.Stub.asInterface(service); } public void onServiceDisconnected(ComponentName className) { mService = null; } }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView v = new TextView(this); setContentView(v); v.setOnClickListener(mCorkyListener); Log.v(TAG, IAidlService.class.getName().toString()); Intent intent = new Intent(IAidlService.class.getName()); bindService(intent, mConnection, Context.BIND_AUTO_CREATE); } @Override public void onStart(){ super.onStart(); Log.d(TAG, "onStart"); test(); } } public void test(){ if (mService == null){ Log.d(TAG, "mService is NULL"); } try { mService.test(); }catch (RemoteException e){ Log.d(TAG, e.toString()); } } } Bear --~--~-~--~~~---~--~~ 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: Custom View using XML layout & EditTexts: SavedState conflict
On Sep 28, 1:15 am, Romain Guy wrote: > Your two views have the same id, so yes, they try to share the same > state. You will need to somehow generate their id to make them unique > (Home does that.) Okay, thanks! I wasn't sure how the SavedState object was being referenced. If it's by ID I have some ideas of how to fix this. I started a thread on anddev (http://www.anddev.org/viewtopic.php? p=27310) and I'll post my workaround there when I write it. Ben > On Sun, Sep 27, 2009 at 10:02 PM, Ben Roberts wrote: > > > I'm trying to figure out how to properly make a custom view consisting > > of a LinearLayout and some children, one of which is a EditText. To > > make this simple, I've pared down the code to the simplest possible > > case. > > > res/layout/bughunt.xml is a basic definition of a custom view; it's > > just a layout with a single EditText inside. > > > > http://schemas.android.com/apk/res/ > > android" > > android:orientation="horizontal" > > android:gravity="center_vertical" > > android:layout_width="wrap_content" > > android:layout_height="wrap_content"> > > > android:id="@+id/text1" > > android:layout_width="wrap_content" > > android:layout_height="40sp" > > android:gravity="center" > > android:width="50sp" > > android:singleLine="true"/> > > > > > My custom view class: > > > public class BugHunt extends LinearLayout { > > > public BugHunt(Context context) { > > super(context); > > initLayout(context); > > } > > > public BugHunt(Context context, AttributeSet attrs) { > > super(context, attrs); > > initLayout(context); > > } > > > private void initLayout(Context context) { > > LayoutInflater i = (LayoutInflater) context.getSystemService > > (Context.LAYOUT_INFLATER_SERVICE); > > i.inflate(R.layout.bughunt, this); > > } > > } > > > Then I put two instances like the following in an Activity layout > > file: > > > layout_width="wrap_content" > > layout_height="wrap_content" /> > > > The problem I'm having is when the EditTexts save state, they > > overwrite each other's state. To reproduce this, put two or more > > instances of BugHunt into an Activity, run it, and enter some > > (different) text into each EditText. Then, switch the screen > > orientation. After the layout is redrawn, all EditTexts will have the > > same text in them (the text from whichever EditText saved state last). > > > I can only guess that I'm not using the LayoutInflater properly. Any > > ideas? > > -- > 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] zipalign : could be done at distribution or installation time ?
I just noticed about zipalign http://developer.android.com/guide/developing/tools/zipalign.html This optimization is to be done after the apk is done / signed. Does this mean that zipalign may be run by the Market itself ? Or even by android at install time on the phone ? --~--~-~--~~~---~--~~ 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] Launch Activity Call without screen change
It is possibile to start an outcoming call without change screen? I've a widget that perform a call for get remaining credit, but I don't want to change screen... If this isn't possibile, is possibile to return to the home screen when the call is terminated? Now the screen remain on last call log. 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] Any suggestion between 1.5 or 1.6 sdk
Hi All, I've been trying to use 1.6 sdk, and see numerous problems 1) Same projects flags for error, but hacking thru the environment using only the eclipse, sometime deleting the gen folder or deleting R.java to solve it. Nothing methodical. I did not have this on 1.5r3 2) Sometime the eclipse editor is locked, killing the AVD releases the editor 3) Debug launch gets stuck at 27%, yes magic number... -pro --~--~-~--~~~---~--~~ 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: trouble with programmatically adding mock location data
Seems i'm talking with myself :-) Seems like it's a bug though, filed: http://code.google.com/p/android/issues/detail?id=4036 On 28 Sep., 12:38, Frederik Pfisterer wrote: > Here is the code using a mock location provider. Basically my question > is, why is the mock provider not returning the previously set mock > location correctly. See last comment in code: > > private GeoPoint getUserLocation() { > > LocationManager locationManager = > (LocationManager)getSystemService > (Context.LOCATION_SERVICE); > > if (!PRODUCTION_ENVIRONMENT){ > > //Get some mock location data in the game > locationManager.addTestProvider(MOCK_PROVIDER_NAME, > true, false, > true, false, false, false, false, Criteria.POWER_LOW, > Criteria.ACCURACY_COARSE); > Location location = new Location(MOCK_PROVIDER_NAME); > location.setLatitude(32.64480); > location.setLongitude(-16.90967); > location.setTime(new Date().getTime()); > > locationManager.setTestProviderLocation(MOCK_PROVIDER_NAME, > location); > > locationManager.setTestProviderEnabled(MOCK_PROVIDER_NAME, true); > > } > > //i just want an approximate location so no high expectations > here > Criteria criteria = new Criteria(); > criteria.setAccuracy(Criteria.ACCURACY_COARSE); > criteria.setPowerRequirement(Criteria.NO_REQUIREMENT); > > //this correctly retrieves the mock location provider > String provider = locationManager.getBestProvider(criteria, > true); > if (provider != null) { > //this is where the mock provider returns null ... why? > Location location = > locationManager.getLastKnownLocation(provider); > return new > GeoPoint((int)(location.getLatitude()*E6_LATLONG), (int) > (location.getLongitude()*E6_LATLONG)); > }else return null; > } > > Might this be a bug in the API? > > On 27 Sep., 16:43, Frederik Pfisterer wrote: > > > I am working on an application that requires an approximate position > > of the user, so basically i am fine with any relatively recent > > location data i can get. However I can't seem to get things right > > using mock location data and would therefore appreciate your help. > > The method i'm having tries to set mock location data for the gps > > provider and tries to later retrievie it BUT: > > locationManager.setTestProviderEnabled("gps", true); seems to fail > > because i do not get any active location provider from the location > > manager. > > When I tried using a mock location provider with addTestProvider and > > give it my mock location, the LocationManager returns me this mock > > provider with getProviders(true) but then getLastKnownLocation returns > > null instead of the provided mock location. > > > Here is my code (see comments as well): > > > private GeoPoint getUserLocation() { > > > LocationManager locationManager = > > (LocationManager)getSystemService > > (Context.LOCATION_SERVICE); > > > if (!PRODUCTION_ENVIRONMENT){ > > //Get some mock location data in the game > > Location location = new Location("gps"); > > location.setLatitude(32.64480); > > location.setLongitude(-16.90967); > > location.setTime(new Date().getTime()); > > locationManager.setTestProviderLocation("gps", > > location); > > locationManager.setTestProviderEnabled("gps", true); > > > //retrieve the list of active providers for > > debugging purposes, the > > activated mock gps provider is not returned here > > List locationProviders = > > locationManager.getProviders > > (true); > > locationManager.setTestProviderEnabled("network", > > true); > > > } > > > //i just want an approximate location so no high > > expectations here > > Criteria criteria = new Criteria(); > > criteria.setAccuracy(Criteria.ACCURACY_COARSE); > > criteria.setPowerRequirement(Criteria.NO_REQUIREMENT); > > > //this correctly retrieves a mock location provider but not > > the mock > > enabled gps > > String provider = > > locationManager.getBestProvider(criteria,true); > > if (provider != null) { > > //this is where the mock provider returns null > > Location location = > > locationManager.getLastKnownLocation(provider); > > return new > > GeoPoint((int)(location.getLatit
[android-developers] MapView Overlays
My problem is my MapView becoming very laggy and so non-responsive at times, that Android thinks its hit deadlock and tries to close it. I am adding 60 overlays to the map view and i originally thought that the icon size may be causing the problem by using up all the memory. When i decreased the overlay icon size, it did improve things, though it is still to slow to be usable. Has anyone experienced anything similar and have a workaround? There may be a better way of doing it other then extending the Hello MapView example. Any thoughts welcomed. Thanks, Liam --~--~-~--~~~---~--~~ 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: launch activity like phone call
ok thanks for the explanation. i learn more :D On Sep 28, 8:13 pm, Mark Murphy wrote: > sleith wrote: > > Hi, > > wanna ask again about Mark's first warning: > > " Your service will not be running for very long once the screen turns > > off. The phone will go to sleep, and your service will stop running > > when > > the phone turns off the CPU. " > > > when the phone turns on the CPU again, will the service restarted > > automatically? > > "Restarted"? A running service will start running again, but to me > "restart" implies it was destroyed and recreated, which does not happen. > > When the CPU shuts down, everything freezes in mid-operation. When the > CPU starts up again, everything continues from where it was. > > Again, I strongly advise against having services run indefinitely. A > well-constructed service only runs when it needs to (via an alarm) and > can arrange via a WakeLock to keep the CPU running for the short period > it needs to run. See more at: > > http://www.androidguys.com/2009/09/09/diamonds-are-forever-services-a... > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > Android Development Wiki:http://wiki.andmob.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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Anyone used performHapticFeedback()?
I want to invoke the haptic feedback buzz when my ImageButton is pressed, but I am not sure the best way to do it. I first checked that my button was enabled for that, and isHapticFeedbackEnabled() returns true. Then I am calling performHapticFeedback() with the constant FLAG_IGNORE_GLOBAL_SETTING, as the docs indicate that will be used to override any global settings. The doc is a little ambiguous, but it does imply that this is something I can call at any time, so I am calling it in the OnClickListener(): final ImageButton mybutton= (ImageButton) findViewById (R.id.mybutton); mybutton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { mybutton.performHapticFeedback (HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); // The rest of my code } } ); I appreciate that it would be better to call it when the finger first touches the button rather than on the Click event, but I wanted to get it working to start with, before refining it. Am I barking completely up the wrong tree, or should the above work when I click on the button, because nothing happens? --~--~-~--~~~---~--~~ 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 prematurely stop a long-running SQLite query?
On Sep 28, 6:02 am, Broc Seib wrote: > Perhaps a Trie data structure? I can see how that would be useful when searching on prefixes, but what about when doing free text search? Also, by "mechanism" I was thinking more along the lines of database, flat file (like a CSV) etc rather than logical data structure. --~--~-~--~~~---~--~~ 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: launch activity like phone call
sleith wrote: > Hi, > wanna ask again about Mark's first warning: > " Your service will not be running for very long once the screen turns > off. The phone will go to sleep, and your service will stop running > when > the phone turns off the CPU. " > > when the phone turns on the CPU again, will the service restarted > automatically? "Restarted"? A running service will start running again, but to me "restart" implies it was destroyed and recreated, which does not happen. When the CPU shuts down, everything freezes in mid-operation. When the CPU starts up again, everything continues from where it was. Again, I strongly advise against having services run indefinitely. A well-constructed service only runs when it needs to (via an alarm) and can arrange via a WakeLock to keep the CPU running for the short period it needs to run. See more at: http://www.androidguys.com/2009/09/09/diamonds-are-forever-services-are-not/ -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Development Wiki: http://wiki.andmob.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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] [Urgent] startActivityForResult
Hi All, Is it a must for me to call startActivityForResult under my class than extends Activity? I'm struggling with my lab sheet. It's about Game of Life (http://en.wikipedia.org/wiki/Conways_life). The source code can be grabbed from here (http://filebeam.com/ 558274259ae956cb411897081ca1665b) Now I'm required to modified the code such that whenever I press the screen, it will start a new activity and prompt the user for input. Then the input is used to draw the points on the screen. The code is split into 4 parts, (GridView, GridDelegate, ViewDelegate and grid). ViewDelegate is the interface class. grid is the activity class. My problem is, how can I call startActivityForResult from GridDelegate? Because I m required to start a new activity whenever I pressed the screen, and the doTouchEvent(Event event) is implemented in GridDelegate. OR any suggestion for me, so that whenever I pressed the screen, I can start a new activity that ask the user for input? I've done defining the new Activity class that ask the user for input (following several tutorials online), but I m stuck here now. Please help me. Regards Kwan --~--~-~--~~~---~--~~ 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: launch activity like phone call
Hi, wanna ask again about Mark's first warning: " Your service will not be running for very long once the screen turns off. The phone will go to sleep, and your service will stop running when the phone turns off the CPU. " when the phone turns on the CPU again, will the service restarted automatically? if it won't, how to know if the CPU has been turned on/off? thanks On Sep 27, 5:35 pm, sleith wrote: > Hi, > thanks Mark for your advice, that's a nice input from you :) > > On Sep 27, 5:26 pm, Mark Murphy wrote: > > > sleith wrote: > > > i've tested when the phone screen is off, the service is still > > > running, but when the service try to start intent, the screen is still > > > not shown because it's off. when the screen is on again, i can see the > > > intent that was launched by service. > > > is there any way to make the screen on by programming? because when we > > > receive call, the screen will on. so i think it is possible :D > > > First, the warnings: > > > 1. Your service will not be running for very long once the screen turns > > off. The phone will go to sleep, and your service will stop running when > > the phone turns off the CPU. > > > 2. Doing things that wake up the phone are bad for battery life. See > > Jeff Sharkey's "Coding for Life...Battery Life, That Is" presentation > > from Google I/O 2009 for statistics. > > > 3. Popping up user interfaces from a service are bad for the user > > experience. If the user is, say, in the middle of typing a text message, > > and your service-spawned activity steals the foreground, they may have > > quite a few profanities to fling in your direction. An incoming phone > > call is one of the few things users might tend to agree warrants such an > > intrusion...and I suspect there are still many a curse word used when > > users get interrupted, even for that. > > > Hence, before you even bother with any code, you need to really make > > sure that this is what you want to do, and consider offering user > > preferences to disable this functionality. > > > All that said, you will want to look at PowerManager.WakeLock to arrange > > to keep the screen and CPU on for a while. Which leads to: > > > 4. Misusing WakeLocks are horrible for the battery. Do not leak an > > acquired WakeLock. > > > -- > > Mark Murphy (a Commons > > Guy)http://commonsware.com|http://twitter.com/commonsguy > > > Android Training in Germany, 18-22 January 2010:http://bignerdranch.com > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] ADC2 - app World of Bombs
Hi all and especially to ADC2 testers. I wanted to inform i had to restart the world of bombs server while ADC2 users were connected. i apologize for that. I found also a bug when you lose so please win to not have a potential app crash which does not occur 100% but preferable to win. I can't modify the version of the server for now because it would be anymore compatible with the ADC2 client version. Anyway, i would like just thank you the testers which already tested and they are a lot. I just hope they have not encountered the bug, if so reconnect and don't be to hard with the game. don't judge that but the game itself since this bug will be corrected. Best regards. for my own ADC2 testing I've tested a lot of apps and i found some nice ones * Eclosion * Runes (even if it a competitor i like this app) * Air Paint * Marble Lines. But Tastes and Colors are personnal so don't take these for money, just my feeling. Regards. Croco -- http://www.zeugame.com/wob2 --~--~-~--~~~---~--~~ 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: Update all the contacts belonging to one group
cyril.at...@gmail.com wrote: > I have an application that updates all the contacts belonging to a > group, I currently do the following : > -> Get the group id > -> Get all the contacts id inside this group > -> For each of them I am doing an update on the contact => This is > really heavy and seems to take time in real phones while I expect it > to be "instantaneous". > > I am wondering if we can, in the ContentResolver.update() method > specify a kind of join. > For instance I'd like to do something like : > UPDATE SET ="" FROM People p, > GroupsMemberships gm WHERE p.person_id=gm.person_id and > gm.group_id= > > Does anyone know if it's possible or not? Not that I am aware of. Bear in mind that not all content providers will be using a SQL database as the place of data storage. Since the contacts content provider does appear to use SQLite, rather than iterating over your contacts, though, you could try the IN syntax in the WHERE-style constraint: [WHERE] person_id IN (...) where ... is a comma-delimited set of values, or possibly even a sub-select to get the IDs of the contacts to update. http://sqlite.org/lang_expr.html -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Looking for Android opportunities? http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ 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: Crossword Puzzle in Android
Hi All, Thanks for the advice from everyone. I've done a little bit of research, but I m not sure the idea of rendering the boxes with numbering is correct or not. Is it true that I can draw on a canvas? I m reading this tutorial http://www.anddev.org/the_pizza_timer_-_threading-drawing_on_canvas-t126.html It seems like after I draw a box, I can still draw on the same place, overlapping it. So I can do something like "drawing" the numbers on top of the boxes right? In face I'm not doing a crossword. It looks similar to crossword but it is called CodeCracker instead. I did a google on "CodeCracker" but the result it returns are mostly something else. Here are a few link on the "CodeCracker" I m saying: http://www.codecracker.co.nz/samples/samples.htm http://www.puzzco.com/knight%20features/interactive/samples/Interactive%20Samples/code-cracker.htm http://www.thepuzzlecompany.co.nz/samples/Interactive%20Samples/code-cracker%20extra.htm Regards Kwan On Mon, Sep 28, 2009 at 2:00 PM, Seth Mould wrote: > > Hi Kwan, > > I have a project on SourceForge called xW which seeks to establish a > standard XML format for word puzzles, so you might want to look at > that for your input. Try looking for open Sudoku projects -- there is > more interest in Sudoku than crosswords and the rendering of cells is > the same except for numbering. > > Please remember that advanced UK crosswords use bars instead of black > squares, so a typical bitwise enumeration for the cell's appearance > will be 0 - Blank, 1 - Black, 2 - Left bar, 4 - Top bar. > > I haven't got round to writing a generic renderer for Android but when > I do it will be Open. Regards Seth > > > > --~--~-~--~~~---~--~~ 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] Update all the contacts belonging to one group
Dear all, I have an application that updates all the contacts belonging to a group, I currently do the following : -> Get the group id -> Get all the contacts id inside this group -> For each of them I am doing an update on the contact => This is really heavy and seems to take time in real phones while I expect it to be "instantaneous". I am wondering if we can, in the ContentResolver.update() method specify a kind of join. For instance I'd like to do something like : UPDATE SET ="" FROM People p, GroupsMemberships gm WHERE p.person_id=gm.person_id and gm.group_id= Does anyone know if it's possible or not? The update method has got a "where" attribut but can we use this attribut for complexe requests ? * where A filter to apply to rows before deleting, formatted as an SQL WHERE clause (excluding the WHERE itself). *** Thanks to everyone for its feedback. --~--~-~--~~~---~--~~ 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: (unofficial) Bluetooth API v. 0.2
Dianne, Is there any chance you or someone else on the Android project can make a statement (if even a vague one) about the Bluetooth API plans and timeline. You can see from the issue tracker (http:// code.google.com/p/android/issues/detail?id=1725) that there is much wailing and gnashing of teeth over this issue Keep up the great work on Android: I'm really looking forward to the Bluetooth API (I have great plans for an app which requires bluetooth which is why I'm anxious to know). Best regards, Joe. On Sep 16, 9:06 pm, windstorm wrote: > Agree with Jonas. We are not trying to break Android's rule but, > sometimes we have to play with things or tricks or whatsoever for > keeping on using Google's phone which rocks but with suckingBluetooth. > Otherwise we have to change the platform, which is the last > thing I wanna see. > > On Sep 16, 1:04 pm, "Jonas Petersson" wrote: > > > > > Dianne Hackborn wrote: > > > Again, this code is using PRIVATE APIs. As we've said repeatedly, doing > > > so is not safe, and you can expect your code to break in various ways as > > > a result.[...] > > > Thank you, Dianne. I'm pretty sure that everyone involved in these two > >Bluetoothprojects are very much aware of this and try to make it clear > > to the potential users too. > > > As I see it, the choice is between having basically no usefulBluetooth > > API and to "boldy go where no man has gone before"... > > > Presumably, the main reason for changing that private API would be to > > make a fully working public API. If (when) that happens everyone will be > > happy. Until then, it should be reasonably safe to examine the build > > number (and hw id etc) and see what can be done by hitting the metal, right? > > > Best / Jonas --~--~-~--~~~---~--~~ 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: trouble with programmatically adding mock location data
Here is the code using a mock location provider. Basically my question is, why is the mock provider not returning the previously set mock location correctly. See last comment in code: private GeoPoint getUserLocation() { LocationManager locationManager = (LocationManager)getSystemService (Context.LOCATION_SERVICE); if (!PRODUCTION_ENVIRONMENT){ //Get some mock location data in the game locationManager.addTestProvider(MOCK_PROVIDER_NAME, true, false, true, false, false, false, false, Criteria.POWER_LOW, Criteria.ACCURACY_COARSE); Location location = new Location(MOCK_PROVIDER_NAME); location.setLatitude(32.64480); location.setLongitude(-16.90967); location.setTime(new Date().getTime()); locationManager.setTestProviderLocation(MOCK_PROVIDER_NAME, location); locationManager.setTestProviderEnabled(MOCK_PROVIDER_NAME, true); } //i just want an approximate location so no high expectations here Criteria criteria = new Criteria(); criteria.setAccuracy(Criteria.ACCURACY_COARSE); criteria.setPowerRequirement(Criteria.NO_REQUIREMENT); //this correctly retrieves the mock location provider String provider = locationManager.getBestProvider(criteria, true); if (provider != null) { //this is where the mock provider returns null ... why? Location location = locationManager.getLastKnownLocation(provider); return new GeoPoint((int)(location.getLatitude()*E6_LATLONG), (int) (location.getLongitude()*E6_LATLONG)); }else return null; } Might this be a bug in the API? On 27 Sep., 16:43, Frederik Pfisterer wrote: > I am working on an application that requires an approximate position > of the user, so basically i am fine with any relatively recent > location data i can get. However I can't seem to get things right > using mock location data and would therefore appreciate your help. > The method i'm having tries to set mock location data for the gps > provider and tries to later retrievie it BUT: > locationManager.setTestProviderEnabled("gps", true); seems to fail > because i do not get any active location provider from the location > manager. > When I tried using a mock location provider with addTestProvider and > give it my mock location, the LocationManager returns me this mock > provider with getProviders(true) but then getLastKnownLocation returns > null instead of the provided mock location. > > Here is my code (see comments as well): > > private GeoPoint getUserLocation() { > > LocationManager locationManager = > (LocationManager)getSystemService > (Context.LOCATION_SERVICE); > > if (!PRODUCTION_ENVIRONMENT){ > //Get some mock location data in the game > Location location = new Location("gps"); > location.setLatitude(32.64480); > location.setLongitude(-16.90967); > location.setTime(new Date().getTime()); > locationManager.setTestProviderLocation("gps", > location); > locationManager.setTestProviderEnabled("gps", true); > > //retrieve the list of active providers for debugging > purposes, the > activated mock gps provider is not returned here > List locationProviders = > locationManager.getProviders > (true); > locationManager.setTestProviderEnabled("network", > true); > > } > > //i just want an approximate location so no high expectations > here > Criteria criteria = new Criteria(); > criteria.setAccuracy(Criteria.ACCURACY_COARSE); > criteria.setPowerRequirement(Criteria.NO_REQUIREMENT); > > //this correctly retrieves a mock location provider but not > the mock > enabled gps > String provider = > locationManager.getBestProvider(criteria,true); > if (provider != null) { > //this is where the mock provider returns null > Location location = > locationManager.getLastKnownLocation(provider); > return new > GeoPoint((int)(location.getLatitude()*E6_LATLONG), (int) > (location.getLongitude()*E6_LATLONG)); > }else return null; > } > > } > > Thanks for any hints or requests for clarification! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to an
[android-developers] Re: Focus MapView
Thanks, thought it would be simple, hadn't come accross MapController yet. Cheers. Liam On Sep 28, 12:21 pm, Mark Murphy wrote: > Ne0 wrote: > > Hi, > > > Thought this might have been covered already, but i cant seem to find > > it anywhere. My app reads GPS positions from a file and overlays them > > on the mapView. All very simple stuff, but how to get the map view to > > go to and zoom in on a point? > > Given a MapView named "map": > > MapController mc=map.getController(); > > mc.animateTo(...); // where ... is your GeoPoint to move to > mc.setZoom(...); // where ... is the zoom level, 1-21 > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > _Beginning Android_ from Apress Now 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: Why are the save/restore lifecycle events called twice when switching the emulator from landscape to portrait?
Is this problem the same as described here? http://code.google.com/p/android/issues/detail?id=2423 Might be worth posting that it is still present in 1.6 if so, all the comments look re 1.5. On Sep 28, 6:19 am, Carl Whalley wrote: > Cheers. I think you're right, but this looks just plain wrong. If > there was a reason for the double Activity creation it should at least > happen in both cases, not just in the landscape to portrait case. Its > actually a little worse than that, because I came across this when > chasing a "bug" in some code which was causing the width in an onLayout > () call to *sometimes* come in as 0, which it turns out is this > spurious lifecycle event. > > --http://www.androidacademy.com > > On Sep 28, 9:27 am, skink wrote: > > > On Sep 27, 1:31 pm, Carl Whalley wrote: > > > > This is with the 1.6 & 1.5 SDKs, not tried earlier ones. When you > > > switch from portrait to landscape the onSaveInstanceState()/ > > > onRestoreInstanceState() pair are called once, but when going back > > > from landscape to portrait they are called twice, unless I've missed > > > something. > > > To test, see the log after creating a default Hello World app and > > > change the main class like this: > > > > public class MainActivity extends Activity { > > > private static final String TAG = "activity"; > > > > /** Called when the activity is first created. */ > > > @Override > > > public void onCreate(Bundle savedInstanceState) { > > > super.onCreate(savedInstanceState); > > > setContentView(new MainView(this)); > > > } > > > > @Override > > > protected void onRestoreInstanceState(Bundle savedInstanceState) { > > > super.onRestoreInstanceState(savedInstanceState); > > > Log.d(TAG, "onRestoreInstanceState()"); > > > } > > > > @Override > > > protected void onSaveInstanceState(Bundle outState) { > > > Log.d(TAG, "onSaveInstanceState()"); > > > super.onSaveInstanceState(outState); > > > } > > > > public class MainView extends LinearLayout { > > > public MainView(Context context) { > > > super(context); > > > inflate(context, R.layout.main, this); > > > } > > > } > > > > } > > > > --http://www.androidacademy.com > > > hi, > > > it's called twice because two activities are created: first one lives > > for a very short time - it's immediately onDestroy()ed. > > > i posted about this couple of months ago but nobody seemed to answer > > > oskink --~--~-~--~~~---~--~~ 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: Focus MapView
Ne0 wrote: > Hi, > > Thought this might have been covered already, but i cant seem to find > it anywhere. My app reads GPS positions from a file and overlays them > on the mapView. All very simple stuff, but how to get the map view to > go to and zoom in on a point? Given a MapView named "map": MapController mc=map.getController(); mc.animateTo(...); // where ... is your GeoPoint to move to mc.setZoom(...); // where ... is the zoom level, 1-21 -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Beginning Android_ from Apress Now 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] Focus MapView
Hi, Thought this might have been covered already, but i cant seem to find it anywhere. My app reads GPS positions from a file and overlays them on the mapView. All very simple stuff, but how to get the map view to go to and zoom in on a point? Thanks Liam --~--~-~--~~~---~--~~ 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] Broken pipe
Hi there, I'm trying to use sockets. I'm trying to use the java client of "gearman", gearman.org, the applications throws: 09-28 12:38:55.805: WARN/logger(1134): java.net.SocketException: Broken pipe 09-28 12:38:55.805: WARN/logger(1134): at org.apache.harmony.luni.platform.OSNetworkSystem.writeSocketImpl (Native Method) 09-28 12:38:55.805: WARN/logger(1134): at org.apache.harmony.luni.platform.OSNetworkSystem.write (OSNetworkSystem.java:105) Do anyone know what's wrong? This exception is thrown when it tries to write into the socketChannel: serverConnection.write(bytesToSend); --~--~-~--~~~---~--~~ 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 full package size?
How to get APK size: File apkfile = new File("path_to_apk"); long apksize = apkFile.length(); // in bytes but how to get Data size? On Sep 28, 6:55 am, SizzlingSkizzorsProgrammer wrote: > how do you get the apk size??? > > On Sep 27, 5:10 pm, iron wrote: > > > Hello everyone! > > > How i can get package size info - code, cache and data size? > > I tried to use PackageStats, but it always returns 0. > > > Right now i can get apk size and dex file size, but how i can get DATA > > size? > > --~--~-~--~~~---~--~~ 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: Why are the save/restore lifecycle events called twice when switching the emulator from landscape to portrait?
Cheers. I think you're right, but this looks just plain wrong. If there was a reason for the double Activity creation it should at least happen in both cases, not just in the landscape to portrait case. Its actually a little worse than that, because I came across this when chasing a "bug" in some code which was causing the width in an onLayout () call to *sometimes* come in as 0, which it turns out is this spurious lifecycle event. -- http://www.androidacademy.com On Sep 28, 9:27 am, skink wrote: > On Sep 27, 1:31 pm, Carl Whalley wrote: > > > > > This is with the 1.6 & 1.5 SDKs, not tried earlier ones. When you > > switch from portrait to landscape the onSaveInstanceState()/ > > onRestoreInstanceState() pair are called once, but when going back > > from landscape to portrait they are called twice, unless I've missed > > something. > > To test, see the log after creating a default Hello World app and > > change the main class like this: > > > public class MainActivity extends Activity { > > private static final String TAG = "activity"; > > > /** Called when the activity is first created. */ > > @Override > > public void onCreate(Bundle savedInstanceState) { > > super.onCreate(savedInstanceState); > > setContentView(new MainView(this)); > > } > > > @Override > > protected void onRestoreInstanceState(Bundle savedInstanceState) { > > super.onRestoreInstanceState(savedInstanceState); > > Log.d(TAG, "onRestoreInstanceState()"); > > } > > > @Override > > protected void onSaveInstanceState(Bundle outState) { > > Log.d(TAG, "onSaveInstanceState()"); > > super.onSaveInstanceState(outState); > > } > > > public class MainView extends LinearLayout { > > public MainView(Context context) { > > super(context); > > inflate(context, R.layout.main, this); > > } > > } > > > } > > > --http://www.androidacademy.com > > hi, > > it's called twice because two activities are created: first one lives > for a very short time - it's immediately onDestroy()ed. > > i posted about this couple of months ago but nobody seemed to answer > > oskink --~--~-~--~~~---~--~~ 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 play music album?
I have album id, how can I start activity to play album? I tried this: Uri album = ContentUris.withAppendedId (MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI, id); Intent playalbum = new Intent(Intent.ACTION_VIEW, album); startActivity(playalbum); but its not working... --~--~-~--~~~---~--~~ 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 sign up for ADC judge?
Search for it in the Market app or use the QR code from the blog post about it: http://android-developers.blogspot.com/2009/09/adc-2-judging-has-begun.html On Sep 28, 2:22 am, parchira tech wrote: > where can I download the ADC judge application? > > Thanks! > > April --~--~-~--~~~---~--~~ 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: Selling license for free apps
Armond Avanes wrote: > Hi Guys, > > Like many other developers here, I can't sell applications from my country > and seeking a way for monetization of my app. > > I was thinking to release my app as free ads-supported version, and to sell > license from my website for those who want to remove the ads completely. > Actually users will apply on my website, pay a fee and I will send a > license. > > But then I came across the following url saying that "collecting payments > through your application is not allowed under the Android Market Developer > Distribution Agreement": > http://market.android.com/support/bin/answer.py?hl=en&answer=140504 > > Is this to prohibit me from doing what I explained above? As always, you are best served by talking to qualified legal counsel about legal issues like this. In this case, I would think "through your application" would mean literally "through your application" -- accepting payments in the app itself. That would not cover payments through a Web site, post office box, envelopes taped to the bottom of park benches, or other means of transfer. But, again, IANALNDIPOOTV (I am not a lawyer, nor do I play one on TV). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need Android talent? Ask on HADO! http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ 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] Selling license for free apps
Hi Guys, Like many other developers here, I can't sell applications from my country and seeking a way for monetization of my app. I was thinking to release my app as free ads-supported version, and to sell license from my website for those who want to remove the ads completely. Actually users will apply on my website, pay a fee and I will send a license. But then I came across the following url saying that "collecting payments through your application is not allowed under the Android Market Developer Distribution Agreement": http://market.android.com/support/bin/answer.py?hl=en&answer=140504 Is this to prohibit me from doing what I explained above? Thank you, Armond --~--~-~--~~~---~--~~ 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: map overlay issue
tstanly wrote: > hi all, > > I used overlay to mark two point on the mapview, > but I only want to removed one point at a time, > but the mapview.getoverlay().clear() will remove two marks for > mapview, No, mapView.getOverlays().clear() removes all *overlays*. > so how can I do for remove one mark only? There is no direct API for that as far as I can see. You may need to create a new ItemizedOverlay with the reduced set of marks, remove the old ItemizedOverlay from the getOverlays() collection, and add in the replacement. Or, you could try calling populate() again and see if that will clear and re-add all of the marks (minus whichever one you are trying to get rid of). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need Android talent? Ask on HADO! http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ 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: Why are the save/restore lifecycle events called twice when switching the emulator from landscape to portrait?
On Sep 27, 1:31 pm, Carl Whalley wrote: > This is with the 1.6 & 1.5 SDKs, not tried earlier ones. When you > switch from portrait to landscape the onSaveInstanceState()/ > onRestoreInstanceState() pair are called once, but when going back > from landscape to portrait they are called twice, unless I've missed > something. > To test, see the log after creating a default Hello World app and > change the main class like this: > > public class MainActivity extends Activity { > private static final String TAG = "activity"; > > /** Called when the activity is first created. */ > @Override > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(new MainView(this)); > } > > @Override > protected void onRestoreInstanceState(Bundle savedInstanceState) { > super.onRestoreInstanceState(savedInstanceState); > Log.d(TAG, "onRestoreInstanceState()"); > } > > @Override > protected void onSaveInstanceState(Bundle outState) { > Log.d(TAG, "onSaveInstanceState()"); > super.onSaveInstanceState(outState); > } > > public class MainView extends LinearLayout { > public MainView(Context context) { > super(context); > inflate(context, R.layout.main, this); > } > } > > } > > --http://www.androidacademy.com hi, it's called twice because two activities are created: first one lives for a very short time - it's immediately onDestroy()ed. i posted about this couple of months ago but nobody seemed to answer oskink --~--~-~--~~~---~--~~ 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: Widgets and custom components?
Moto wrote: > Yes, I meant widgets for home screen... That's bad news for me I > guess... :( The only animation I got working barely was marquee text. > lol... > > I wonder if there are plans to expand this feature... Animations would > be great! :( or even better custom components... The issue is security. You can't have third-party code run in the home screen's process without introducing security holes, which is why RemoteViews exists in the first place. That pretty much eliminates custom components, at least as the term is traditionally used (i.e., things that would draw on a Canvas). Android has fairly consistently held to the pattern that security trumps all else when desires collide, and I for one am rather happy with that policy. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need Android talent? Ask on HADO! http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ 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: Prevent radio button from being checked when being clicked
Marian Schedenig wrote: > In my activity I have two radio buttons which both require additional > input. Clicking either button opens a dialog, and only clicking "set" > in that dialog really activates the option. I therefore want to > prevent the radio button from being checked before the value is set, > i.e. I want to prevent it from being automatically checked when the > user clicks it. In my dialog listener I will then manually check the > respective button. > > I could just keep the current state of the radio group in a variable > and instantly re-set it whenever a radio button is clicked, but > perhaps there is a more correct way to do this? I'm skeptical that using radio buttons is the correct UI choice. Consider a couple of regular Buttons to launch your dialog(s) and an ImageView showing an icon indicating the user's choice, or something like that. The point behind common widgets, like radio buttons, is to make the user's life easier via a consistent experience. Users, when they see radio buttons, will expect standard behavior. The more you depart from that behavior, the more confused your users may get. Having a radio button pop a dialog, IMHO, is an unexpected behavior. Having a radio button pop a dialog, and then *not* have that radio button behave like a radio button (i.e., be selected) based upon your own rules, IMHO, is *really* unexpected behavior. If you want to stick with radio buttons, though, I suspect your current implementation is going to be about as good as it gets. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need Android talent? Ask on HADO! http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ 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: WebView onLoadComplete()?
Thanks Mark, that was exactly what I needed. You rule. Cheers :-) //Johan On 27 Sep, 17:23, Mark Murphy wrote: > Walles wrote: > > I have aWebViewthat I've asked to load a page usingwebView.loadUrl > > (). > > > How do I get a notification when theWebViewhas completed loading + > > rendering the requested page? > > Step #1: Implement a custom subclass of WebViewClient, overriding > onPageFinished() and putting in there your logic to be invoked when the > page is ready: > > http://developer.android.com/reference/android/webkit/WebViewClient.h...) > > Step #2: Attach an instance of that WebViewClient subclass to theWebViewvia > setWebViewClient(): > > http://developer.android.com/reference/android/webkit/WebView.html#se...) > > Step #3: There is no Step #3 > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://twitter.com/commonsguy > > _Beginning Android_ from Apress Now 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: Last modification time for each contact record in People table
Now I use compare and search the whole database when onChange() comes On Sep 17, 7:45 pm, Girish wrote: > Please Suggest me that how can we check the updation of each contact > in the Contact.People table? > > On Sep 16, 9:50 am,AlexTang wrote: > > > > > In "people table" there is none column for last modify time. > > > On Sep 15, 8:38 pm, Girish wrote: > > > > Dear All, > > > > I would like to the get the last modification time for each Contact in > > > android.provider.Contacts.People table. I have the following queries, > > > > a) Is there any column to notify that this contact record is updated. > > > > b) Is any column is available like last modification time or revision > > > time to indicate the changes in each record(Each row in table). > > > > Please provide us details. > > > > Thanks, > > > Girish- 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] Does starting a query will notify content observer?
Hi, I have called an AsyncQueryHandler's startQuery function with a specified URL, will all the content observer observing that URL get notified? I asked this question because I don't understand how RecentCallsListActivity's Delete All function works. Here is the code, with comment: case MENU_ITEM_DELETE_ALL: { getContentResolver().delete(Calls.CONTENT_URI, null, null); //TODO The change notification should do this automatically, but it isn't working // right now. Remove this when the change notification is working properly. startQuery(); return true; It appears the call to startQuery() is a work-around to fix the notification not working for the delete() case. But the startQuery is merely calling AsyncQueryHandler's startQuery function. mQueryHandler.cancelOperation(QUERY_TOKEN); mQueryHandler.startQuery(QUERY_TOKEN, null, Calls.CONTENT_URI, CALL_LOG_PROJECTION, null, null, Calls.DEFAULT_SORT_ORDER); This won't trigger any changes in the Calls.CONTENT_URL. So how will this extra call to 'startQuery()' fixes the notification problem described in the comment? 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: ADC2 entries so far...
My ADC2 app is aPortaDrum. It is a drumming application that allows you to play using the phone as a drumstick. Please first check the live demo at http://www.youtube.com/watch?v=ON1cxNU0K8w to see how it uses. For more info, please visit http://android.a0soft.com/?url=aPortaDrum.htm You can download aPortaDrum from "ADC 2" app. Sam --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---