[android-beginners] Re: Database handling - when do you open and close
Ok I tried to find out at which point the service is started and when I can access its database variable. The logs I used showed that the services onCreate() is called after the onResume() method by my activity. That is a bit late because I need access to the database before onResume() to fill the views with data. Is there a way to tell the activity to wait until the service is started? On 5 Aug., 22:54, Kostya Vasilyev kmans...@gmail.com wrote: Starting / binding to a service is asynchronous. You can't call bindService and expect it to be already started and bound by the next line. Call bindService and return control to Android by returning from onCreate or whatever. Your service connection callback will be invoked a little later, once the service is started. -- Kostya Vasilyev --http://kmansoft.wordpress.com 06.08.2010 0:49 пользователь Bender abende...@googlemail.com написал: -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
Re: [android-beginners] Re: Database handling - when do you open and close
Sure. The service connection callback you seem to already have in your code. -- Kostya Vasilyev -- http://kmansoft.wordpress.com 06.08.2010 12:10 пользователь Bender abende...@googlemail.com написал: Ok I tried to find out at which point the service is started and when I can access its database variable. The logs I used showed that the services onCreate() is called after the onResume() method by my activity. That is a bit late because I need access to the database before onResume() to fill the views with data. Is there a way to tell the activity to wait until the service is started? On 5 Aug., 22:54, Kostya Vasilyev kmans...@gmail.com wrote: Starting / binding to a service is ... 06.08.2010 0:49 пользователь Bender abende...@googlemail.com написал: -- You received this message because you are subscribed to the Google Groups Android Beginners... ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information abo... http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to and... -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Hey my friend,
Hey my friend, Hello, I found a good company Electronicnets! My friends introduced it to me and now I would like to introduce it to you, for it is really very good and they now have a promotion. You can find various electronic products. Originating from original factory, their products have received high market recognition based on their elegant appearance and economical factors. It has been confirmed that it provides high-quality products and quality services. Same products, much lower prices! Share my happiness quickly. Come to visit www.electronicnets.com Good luck! -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Database handling - when do you open and close
I tried the following in my activity: mServiceConnection = new DbServiceConnection(mDatabaseBinder); final Intent databaseServiceIntent = new Intent(this, DatabaseService.class); this.bindService(databaseServiceIntent, mServiceConnection, Context.BIND_AUTO_CREATE); while(mDatabaseBinder == null) { try { Thread.sleep(100); } catch (InterruptedException e) { // catch... } } Did you mean that? Now it should wait until the mDatabaseBinder is set which should be in the onServiceConnected() method but that code results in an endless loop, mDatabaseBinder stays null. Maybe I got it wrong how the components work together. As far as I understood it, you have a service running in the background, which returns a binder in onBind(). The service connection fills the binder onServiceConnected() so it can be used in the activity to access the services variables. Is that wrong? On 6 Aug., 10:26, Kostya Vasilyev kmans...@gmail.com wrote: Sure. The service connection callback you seem to already have in your code. -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
Re: [android-beginners] Re: Database handling - when do you open and close
No, calling Thread.sleep() won't work. Android framework is largely single-threaded, event-driven. This means that your application and the framework run on the same thread, passing control to each other, doing work in small pieces. This thread is called the UI thread, and blocking it by calling sleep() can do only one thing - cause the Application Not Responding dialog to appear. The right thing to do is call bindService, and return from onResume. You've done your piece of work (responded to onResume, and requested that Android bind a service). Now you need to give Android a chance to do its piece of work - by returning from onResume into Android framework code, which will start the service (if necessary) and bind it, notifying your callback. Then it's your turn again - once in the ServiceConnection callback, you know the service has been bound, and you can talk to the service and ultimately populate the UI. So that's basically the scheme with services. You might also want to look at ContentProviders. They have a few advantages over Services for this case - their lifecycle is managed by Android, access is synchronous (using ContentResolver), and they handle propagating data changes to existing queries / cursors (so if you have a ListView, its data will be live). -- Kostya 06.08.2010 12:52, Bender пишет: I tried the following in my activity: mServiceConnection = new DbServiceConnection(mDatabaseBinder); final Intent databaseServiceIntent = new Intent(this, DatabaseService.class); this.bindService(databaseServiceIntent, mServiceConnection, Context.BIND_AUTO_CREATE); while(mDatabaseBinder == null) { try { Thread.sleep(100); } catch (InterruptedException e) { // catch... } } Did you mean that? Now it should wait until the mDatabaseBinder is set which should be in the onServiceConnected() method but that code results in an endless loop, mDatabaseBinder stays null. Maybe I got it wrong how the components work together. As far as I understood it, you have a service running in the background, which returns a binder in onBind(). The service connection fills the binder onServiceConnected() so it can be used in the activity to access the services variables. Is that wrong? On 6 Aug., 10:26, Kostya Vasilyevkmans...@gmail.com wrote: Sure. The service connection callback you seem to already have in your code. -- Kostya Vasilyev --http://kmansoft.wordpress.com -- Kostya Vasilev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: how to change colours in a .xml defined layout in run time
Thank you very much for your input I have solved the problem and the application is now ready for trial. best regards ckloch On 23 Jun., 17:38, TreKing treking...@gmail.com wrote: On Wed, Jun 16, 2010 at 6:55 AM, ckloch htc.kl...@hotmail.com wrote: In theory it seems to be easy, but I would highly appreciate your help on how to do this in Android as I cannot see how I start changing the colours of the individual bar in the screen after initially defining the screen. Whatever View you're using to represent the bars should have some background property for changing it's background image or color. Try that. ----- TreKing - Chicago transit tracking app for Android-powered deviceshttp://sites.google.com/site/rezmobileapps/treking -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: How comes that the estimate time becomes negative
Dear all, I have solved my problem, so the issue below is no logner relevant Thank you for all the great input I have got in this forum best regards CKLOCH On 22 Jun., 11:25, ckloch htc.kl...@hotmail.com wrote: Dear all, I have developed a small app that helps the driver to regulate his speed in order to pass the traffic light when it is green; and thereby minimizing the number of times that he has to stop for red. But, the app does not always work as anticipated. In my app, I need to get the timedifference from when he starts driving to the actual time. This time is needed in order to calculate whether he will reach the light when it is green, or if he needs to slow down in case the current speed is too high. I will appreciate any help that can guide me in the right direction to identify the problem: is it due to Java and that it cannot control the on-going queueing of GPS data? is it due to problems with HTC Hero and Android 1.5; or is it something much more simple that causes my problem. Please, send me your input. I have inserted the most relevant parts of the code below which is structurized as: 1) gpspos() is the function called when I want to start the routine (the main app is launched before). 2) initial_time should contain the timesample from when I call the routine. That is the reason why I set it to zero in the beginning and then update it the first time the conditions distance_1 radius and counter_L are fulfilled. These conditions are fulfilled when I call gpspos(). 3) time=location.getTime() is the GPS clock. 4) double spend_time_1_sec = (time - initial_time); determines the time spend since I called gpspos(). Thank you for your time and helpCKLOCH public void gpspos() { super.onResume(); LocationManager locMgr = (LocationManager) getSystemService(Context.LOCATION_SERVICE); LocationListener locListener = new LocationListener() { double initial_time = 0; public void onLocationChanged(Location location) { if (location != null) { double time = location.getTime()/1000; double spend_time_1_sec = (time - initial_time); if (distance_1radius counter_L==1) // This is only true once when the routine gpspos() is called { initial_time = location.getTime()/1000; // initial_time is in seconds } } } }- Skjul tekst i anførselstegn - - Vis tekst i anførselstegn - -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: WQVGA not respecting android:layout_height=fill_parent for layout.
I have got some support on this and my problem is now solved both on Android 1.5 and 2.1 Best regards ckloch On 17 Jun., 20:41, ckloch htc.kl...@hotmail.com wrote: Thanks for this inspiring contribtion. I have just ran in to the same problem with a HTC Hero Android 1.5 By using android:layout_width=fill_parent, the screen does only take approximately half of the width of the screen while the rest is black. So, does it mean that I have to dictate the width in inches/mm to fill the entire width of the screen, or are there other ways to do? Thank you for your helpckloch On 14 Maj, 19:18, Stormtap Studios r...@stormtapstudios.com wrote: Ok, that makes sense for 1.6+ devices. What will happen on small screen devices like QVGA-P and QVGA-L running 1.5 if you specify a - small resource folder? Will it use the -small folder if that minimum sdk level is set, or does that SDK level just know nothing about that folder and keep on using the regular ones? Rob On May 14, 10:03šam, Kostya Vasilyev kmans...@gmail.com wrote: You can build against 1.6 and set min-sdk to 3, also set supports-screens for high and low screen support. There was a topic here recently about properly specifying drawables. 14 ÍÁÑ, 2010 8:47 PM ÐÏÌØÚÏ×ÁÔÅÌØ Stormtap Studios r...@stormtapstudios.com ÎÁÐÉÓÁÌ: I've found the reason this happens. šAccording to the documentation: Compatibility-mode display on larger screen-sizes If the current screen's size is larger than your application supports, as specified in the supports-screens element, the platform displays the application at the baseline size (normal) and density (medium). For screens larger than baseline, the platform displays the application in a baseline-sized portion of the overall screen, against a black background. This is what's happening to me. Unfortunately my app is being built against Android 1.5 and I can't include the supports-screens tag in the manifest to indicate that I support the large screens which would allow it to scale properly. Does anyone know of a way to tell the screen to stretch /fill_parent on large screens in Android 1.5? Thanks, Rob On May 13, 7:43 pm, Stormtap Studios r...@stormtapstudios.com wrote: Hi guys, I have this l... NEW! Try asking and tagging your question on Stack Overflow athttp:// stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2Bunsubscr i...@googlegroups.com For more options, visit this group athttp:// groups.google.com/group/android-beginners?hl=en -- You received this message because you are subscribed to the Google Groups Android Beginners g... -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow athttp://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-beginners?hl=en -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow athttp://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-beginners?hl=en-Skjul tekst i anførselstegn - - Vis tekst i anførselstegn -- Skjul tekst i anførselstegn - - Vis tekst i anførselstegn - -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] JavaPassion.com now offers Android Programming (with Passion!)
JavaPassion.com now offers Android Programming (with Passion!) online course. Please see some sample lab documents below. Building Helloworld Android application http://www.javapassion.com/handsonlabs/android_stepbystep Android UI Layout http://www.javapassion.com/handsonlabs/android_ui_layout Android UI Menu http://www.javapassion.com/handsonlabs/android_ui_menu Android UI Dialog http://www.javapassion.com/handsonlabs/android_ui_dialog Android UI Misc http://www.javapassion.com/handsonlabs/android_ui_misc For registration, please go to http://www.javapassion.com Thanks. -Sang Shin -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] html formated email
Hi all I am trying to send email with html formated. I like to send some text with hyperlink and I am trying with following code. String body = a href=http://www.example.comExample/a final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType(text/html); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(body)); startActivity(Intent.createChooser(emailIntent, Email:)); The mail sends successfully but there is no hyperlink. How can I use hyperlink on mail . regards NBS -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
Re: [android-beginners] Re: ATTENTION: Android-Beginners will be permanently disabled on August 9 2010
On Wed, Aug 4, 2010 at 8:32 PM, Indicator Veritatis mej1...@yahoo.com wrote: Yes, the distinction has been getting blurred. This is a bad thing. Discontinuing this group only makes the blurring worse, as more and more beginners will move to android-developers -- where beginning questions really do not belong. Stackoverflow is much, much too restrictive for my taste, especially for beginners. I can't properly tag my own question since I'm a stackoverflow beginner :( snip # users with less than 1500 reputation can't create new tags. The tags 'rails3 linecache' are new. Try using existing tags instead. /snip Good luck only tagging questions that already have popular tags. -- Greg Donald destiney.com | gregdonald.com -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Default values in SharedPreferences
My application is somewhat complex and has lots of settable preferences. Fortunately for the user, there are sensible defaults that I can pre-configure. The SharedPreferences infrastructure includes defaults in preferences.xml, which I have set accordingly. The trouble is that if the user has never changed a particular preference, then SharedPreferences.contains(key) returns false and SharedPreferences.getXXX(key,default) returns the default field. This creates a code management issue for defaults. The default values need to be stored in two different places and kept in sync. Ideally, the SharedPreferences infrastructure could be told to read in the entire preferences.xml file so the SharedPreferences database is loaded with all the initial values. But I haven't found any way to do that. A key-value pair doesn't come into existence in the database until the value is changed in the UI. Second best would be to use the XMLReader to grab the default values, something like this: foo = SharedPreferences.getXXX(key,myDefaultReader(key)); Third best would be to store the defaults in their own file and manage SharedPreferences files and defaults files as pairs. Then on application startup the defaults file would be read and the values propagated into the SharedPreferences database. This is such a generic problem that I'm hoping someone has already solved it and I can get something off the shelf. Any suggestions? -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
Re: [android-beginners] Default values in SharedPreferences
On Fri, Aug 6, 2010 at 3:24 PM, Bret Foreman bret.fore...@gmail.com wrote: This is such a generic problem that I'm hoping someone has already solved it and I can get something off the shelf. Any suggestions? I haven't done this (yet) but you could probably store your default values as resources then reference them in the preferences layout and in code as necessary. Still slightly redundant, but at least then there is only one place to go modify the default value. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: ATTENTION: Android-Beginners will be permanently disabled on August 9 2010
On Aug 6, 1:20 pm, Greg Donald gdon...@gmail.com wrote: snip # users with less than 1500 reputation can't create new tags. The tags 'rails3 linecache' are new. Try using existing tags instead. /snip Good luck only tagging questions that already have popular tags. What advantage do you expect to gain from creating new tags? I do a daily walk through stackoverflow for questions tagged with android. Nobody will be searching based on esoteric tags. I think the point of restricting tag generation is to ensure that people *do* find your question because it exists in a pool of other similar questions that people are examining. -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
Re: [android-beginners] Re: ATTENTION: Android-Beginners will be permanently disabled on August 9 2010
On Fri, Aug 6, 2010 at 3:52 PM, fadden fad...@android.com wrote: I do a daily walk through stackoverflow for questions tagged with android. Nobody will be searching based on esoteric tags. I think the point of restricting tag generation is to ensure that people *do* find your question because it exists in a pool of other similar questions that people are examining. I have a problem with linecache. There's no tag for it. I couldn't create one. I did go ahead and choose other tags, ones not as relevant as the ONE I wanted. But whatever. It's a stupid restriction. 1500 reputation before I can even properly tag my question? I've developed sites that used tags plenty of times before.. it's just a join table, not a huge deal. For them to act like tags are so important n00bs like me can't create one? Fuck them and their 1500 reputation tags. I've never once got help from there. I tried again today as a last resort. I'm expecting nothing, as it's likely that's what I'll be getting. -- Greg Donald destiney.com | gregdonald.com -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Default values in SharedPreferences
Yeah, that's messy, but it will probably work. One other consideration is what the next version of Android will do about this. It's pretty clear that this is an important missing feature. I expect they'll eventually make a version of getXXX that reads the default value from preferences.xml if there's no key-value pair in the database yet, and throws an exception if no default value is found. From that perspective, it makes more sense to put a wrapper around getXXX and do my own parsing of the default values from preferences.xml. This has the added advantage that addition and removal of new preference keys can happen in the same file where the defaults are defined. And then when the improved version of getXXX comes out, I can just remove the wrapper. The drawback of this is that I know very little about XML parsers. It looks like I can use DocumentBuilder.parse for this purpose if I can figure out how to open the file. Does this code look right for getting at the raw xml data? AssetManager myAssets = myContext.getAssets(); DisplayMetrics myDM = new DisplayMetrics(); myDM.setToDefaults(); Configuration myConfig = new Configuration(); myConfig.setToDefaults(); Resources myResources = new Resources( myAssets , myDM , myConfig ); prefInputStream = myResources.openRawResource(R.xml.preferences); -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Interaction between an Activity and a Service ?
Thanks Justin, this helps :) :) Rajesh. On Aug 2, 11:52 pm, Justin Anderson janderson@gmail.com wrote: You can pass information via the Intents used to start the service, and vice versa, with the various put and get methods on Intent. For more information, see this link:http://developer.android.com/resources/faq/framework.html#3 -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Sun, Aug 1, 2010 at 2:30 PM, Rajesh Bachani rajesh.bach...@gmail.comwrote: Hello friends! I am trying to explore how information can be exchanged between activities and services. So, if we have Activity A and a Service S is started from A, using the startService() method - is there a way to pass parameters to the Service - and also receive values from the Service into the Activity once the stopService() method is called? I am using Intent to start the service, as one would expect. And further what is the advantage of calling the onBind method, as opposed to the onStart(). Thanks, Rajesh. -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
Re: [android-beginners] Re: Default values in SharedPreferences
On Fri, Aug 6, 2010 at 5:38 PM, Bret Foreman bret.fore...@gmail.com wrote: One other consideration is what the next version of Android will do about this. It's pretty clear that this is an important missing feature. I expect they'll eventually make a version of getXXX that reads the default value from preferences.xml if there's no key-value pair in the database yet, and throws an exception if no default value is found. I can't imagine this would change anytime soon, if at all. I've never found this to be that big of a deal personally. Granted, it's annoying when you have to change the default value, but my suggestion for using resources should solve that. From that perspective, it makes more sense to put a wrapper around getXXX and do my own parsing of the default values from preferences.xml. This has the added advantage that addition and removal of new preference keys can happen in the same file where the defaults are defined. And then when the improved version of getXXX comes out, I can just remove the wrapper. Those are big assumptions about what will or will not happen. Does this code look right for getting at the raw xml data? Seems like overkill. Assuming you're in Activity: InputStream is = getResources().openRawResource(R.xml.preferences); That's it. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Beginners group. ATTENTION: Android-Beginners will be permanently disabled on August 9 2010. For more information about this change, please read [http://goo.gl/xkfl] or visit the Group home page. Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en