Re: [android-developers] Re: custom events in android
Yes, I am familiar with that mechanism. However, that is not like the event/eventhandler mechanism that is available in javascript/gwt. In the asynctask mechanism, the asynctask#postExecute runs on the UI thread and the asynctask needs to passed in a view if a specific view needs to be updated. however, in the javascript mechanism of event/eventhandler, the component that fires the event does not need to know anything about who is going to receive that event. So, it allows for a bit of modular design (clean separation of functionality/view logic/data model). The async task mechanism is, like you said, a multi-threading mechanism in android, however, the event/eventhandler model is more akin to javascript's event model or akin to the JMS publish/subscribe model in JEE. I can see how the async task mechanism can be used in lieu of the event/eventhandler mechanism, but thats not apples to apples. make sense? Thanks for your response! On Tue, Jul 5, 2011 at 12:43 AM, Jastp jaswant1...@gmail.com wrote: It's so simple: There r two best ways: 1. Create a class extending AsyncTask and overrides it's doBackgroud() and and on postExecute() methods and write your code of fetching data from server in doBackground() mtd and onPostExecute() write ur code of db updation and start a new activity; 2.Another ways is the use of traditional java threading; just start a new thread and write your code of fetching data from server and code of db updation in run() mtd and after that code use Activity's runOnUiThread() mtd to start new activirty -- 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 -- 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
Re: [android-developers] Re: in-memory caching?
Thank you everyone! It sounds like there are quite a few ways of fetching and storing data. For caching though, it sounds like the platform is open just as java is. I will likely use a singleton class that holds static members to hold my data. Thank you again. On Tue, Jul 5, 2011 at 4:06 PM, Kees Jongenburger kees.jongenbur...@gmail.com wrote: Hi On Tuesday, July 5, 2011 6:26:42 PM UTC+2, doles wrote: Hello, How is in-memory caching achieved in android? For example, i have static data such as state list in the United States. I would like to keep that list in a file or somewhere in an online service. However, when the app is running, I'd rather store in memory in the app itself. How is that achieved? I could create a singleton and initialize that on startup. What are the best practices if any? Thank you for reading and responding! I think that generally you should try and follow Android design patterns. That means that your data should be kept either in a service or perhaps even better in a content provider. This allows Android to better manage situation where it wants or needs to free up some memory. Greetings -- 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 -- 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] question about onclick xml attribute for views
Hello! On the javadoc for the android:onclick xml attribute, it says the following. What does the part about being able to provide a reference to a resource mean? Do I have the ability to configure any class in my project to be a handler for onclick events or does it have to be a context (activity)? Daring to follow the javadoc as it looked did not help. I had this line: android:onClick=@com.gv.android:Handler:makeMeCoffee for a method named com.gv.andoid.Handler#makeMeCoffee. However, the compiler complained with layout\student_listing.xml:11: error: Error: No resource type specified (at 'onClick' with value '@com.gv.android:Handler:makeMeCoffee').. Yes, I do have the Handler class with a makeMeCoffee method. android:onClick Since: API Levelhttp://developer.android.com/guide/appendix/api-levels.html#level Name of the method in this View's context to invoke when the view is clicked. This name must correspond to a public method that takes exactly one parameter of type View. For instance, if you specify android:onClick=sayHello, you must declare a public void sayHello(View v) method of your context (typically, your Activity). Must be a string value, using '\\;' to escape characters such as '\\n' or '\\u' for a unicode character. This may also be a reference to a resource (in the form @[*package*:]*type* :*name*) or theme attribute (in the form ?[*package*:][*type*:]*name*) containing a value of this type. This corresponds to the global attribute resource symbol onClickhttp://developer.android.com/reference/android/R.attr.html#onClick . Related Methods -- 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
Re: [android-developers] String.split(regex) behaving funny
Thanks! On Jul 2, 2011 2:37 PM, Kostya Vasilyev kmans...@gmail.com wrote: The vertical bar has special meaning in Java regular expressions. Use split(\\|) instead. -- Kostya 02.07.2011 23:24, doles пишет: Hello Everybody, On 3.1, I have a string like this: 130097|2.AQBZGBy6H.600.109.3-4061710|SLC2X7cz9e5-3J68Q . It looks like 3 parts separated by a '|'. So, when I use split on it like this: String [] parts = accessToken.split(|); I expect parts to be of length 3. Surprisingly, when i run and step into that part, the length for parts comes to as many characters there are in that string and not 3. So android String.split does not work like java's string.split? Thanks!!! -- Kostya Vasilyev -- 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 -- 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
Re: [android-developers] Re: unable to set gps geo fix
Nope. I have not gotten ahead with that problem at all. Still have it. On Jan 14, 2011 7:37 AM, dan dany.yac...@gmail.com wrote: Hi i too have the same problem, i'm using eclipse helios sdk 2.3 windows XP please if you have any info on why this is happening. My application is a simple HelloAndroid with GPS thanks On Jan 14, 5:11 am, Simon Haines con.amalgam...@gmail.com wrote: Yes I also have tried setting theemulatorlocation via 'geo fix' with the same result:emulatorcrash. Sorry I can't be of further help. On Dec 14 2010, 1:00 pm, doles sachin.d...@gmail.com wrote: Hello Folks, Has anyone else tried setting location in theemulatorat all? When I try to set location in theemulatorthrough theddmsUI or through the telnet command prompt, myemulatorcrashes. I am running it on windows 32 bit with jdk 1.6 _22 Please help. Thanks On Dec 12, 9:31 am, doles sachin.d...@gmail.com wrote: Hello, I am slowly coming to the conclusion that theddmsping problem might be something that I could ignore because that command is only to find out if theemulatorhas started to run. I amnotsure though, so i am going to focus on mygpsproblem for now and here is some extra information: when i start theemulator, i am seeing this in the error log: 12-12 09:27:44.551: ERROR/ThrottleService(61): CouldnotopenGPS configuration file /etc/gps.conf Do I have to provide agps.conf somewhere if i want to get locations fromgpsin theemulator? Thank you On Dec 11, 11:06 pm, doles sachin.d...@gmail.com wrote: Hello, I have a simple class like the Hello MapView example on android dev guide. I have added a location listener to it and when this app runs on myemulator, i telnet to theemulatorand send a geo fix such as geo fix 1 1. This is causing theemulatorto crash with a thread dump and a list of services that died... what could be wrong? The other thing that happens before theemulatorstarts is that my IDE starts ddmswith arguments pingemulatorstandalone. This results in an error at at com.android.sdkstats.SdkStatsService.normalizeVersion(SdkStatsService.java: 467). At this line, it is clear that that class is expecting a 4 digit number with dots in it and my IDE is sending in the word standalone. I dont know if these two are related, but I need the ability to set geo fixes and that isnotworking!!! Has anyone seen this? What am I missing? 12-11 23:02:52.378: INFO/DEBUG(31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 12-11 23:02:52.378: INFO/DEBUG(31): Build fingerprint: 'generic/ google_sdk/generic:2.3/GRH55/79397:eng/test-keys' 12-11 23:02:52.378: INFO/DEBUG(31): pid: 61, tid: 138 system_server 12-11 23:02:52.387: INFO/DEBUG(31): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 12-11 23:02:52.397: INFO/DEBUG(31): r0 r1 406506a0 r2 4128fab4 r3 458f3c74 12-11 23:02:52.397: INFO/DEBUG(31): r4 012c r5 r6 406506a0 r7 4128fab4 12-11 23:02:52.407: INFO/DEBUG(31): r8 84301321 r9 84302240 10 0010 fp 0001 12-11 23:02:52.417: INFO/DEBUG(31): ip 82f0e7d4 sp 458f3c60 lr 82f0ab37 pc 82f07d0e cpsr 0030 12-11 23:02:52.768: INFO/DEBUG(31): #00 pc 7d0e /system/lib/ libandroid_servers.so 12-11 23:02:52.768: INFO/DEBUG(31): #01 pc ab32 /system/lib/ libandroid_servers.so 12-11 23:02:52.768: INFO/DEBUG(31): #02 pc 12ca /system/lib/hw/ gps.goldfish.so 12-11 23:02:52.778: INFO/DEBUG(31): #03 pc 14ae /system/lib/hw/ gps.goldfish.so 12-11 23:02:52.778: INFO/DEBUG(31): #04 pc 00011a7c /system/lib/ libc.so 12-11 23:02:52.778: INFO/DEBUG(31): #05 pc 00011640 /system/lib/ libc.so 12-11 23:02:52.788: INFO/DEBUG(31): code around pc: 12-11 23:02:52.788: INFO/DEBUG(31): 82f07cec ab04b082 9301cb04 6f646804 b00247a0 12-11 23:02:52.788: INFO/DEBUG(31): 82f07cfc bc08bc10 4718b002 b510b40c ab04b082 12-11 23:02:52.788: INFO/DEBUG(31): 82f07d0c 6804cb04 34f89301 47a06824 bc10b002 12-11 23:02:52.788: INFO/DEBUG(31): 82f07d1c b002bc08 46c04718 b510b40c ab04b082 12-11 23:02:52.797: INFO/DEBUG(31): 82f07d2c 9301cb04 34986804 47a06824 bc10b002 12-11 23:02:52.797: INFO/DEBUG(31): code around lr: 12-11 23:02:52.797: INFO/DEBUG(31): 82f0ab14 91099008 f7fb6aa0 900aeb14 1c3a910b 12-11 23:02:52.797: INFO/DEBUG(31): 82f0ab24 6b646b23 930c1c28 1c31940d f7fd9b0f 12-11 23:02:52.797: INFO/DEBUG(31): 82f0ab34 4906f8e7 44791c28 f7ff3150 b011fe1d 12-11 23:02:52.807: INFO/DEBUG(31): 82f0ab44 46c0bdf0 454c 42c8 0786 12-11 23:02:52.807: INFO/DEBUG(31): 82f0ab54 f7fbb510 bd10ec7c 4802b510 f7fb4478 12-11 23:02:52.807: INFO/DEBUG(31): stack: 12-11 23:02:52.807: INFO/DEBUG(31): 458f3c20 12-11 23:02:52.807: INFO/DEBUG(31):
Re: [android-developers] Re: source for SDK
so, it looks like i have to get Git and use git to download sources... and it looks like i might have to download all the 2.1 gigs and leave it to my IDE to figure out which exact file i need cuz i dont know which project i need amongst the many projects listed on http://android.git.kernel.org/. Do you know which projects I really need if i needed the API source code for developing applications for the android platform? Thank you On Tue, Dec 7, 2010 at 1:42 AM, Bob Kerns r...@acm.org wrote: You know, those of us who normally develop with Windows would certainly appreciate a nice .zip file of at least the .java sources. It doesn't have to be buildable, or even complete to every last obscure file. Just something similar to how Sun/Oracle provide src.zip. Yes, I can fire up a virtual machine or Amazon EC2 instance, and make my own. In fact, I'm loading the sources into an Amazon EC2 instance right now, but it's a lot more time consuming than it needs to be -- and there are a lot of us Windows-using developers out here, believe it or not! On Dec 6, 8:48 pm, Xavier Ducrohet x...@android.com wrote: http://source.android.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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: source for SDK
Yep, I have the SDK. I would like to step into source code every now and then to understand what it does when I write code. So, when I write an activity, I would like to read the source code the the Activity.java class. Your idea does make sense though. On Tue, Dec 7, 2010 at 5:31 AM, guillaume benats guillaume.ben...@gmail.com wrote: Hi, you do not actually need the sources of Android to develop applications, Just the sdk...:http://developer.android.com/sdk/installing.html follow those steps to run it under eclipse! On Tue, Dec 7, 2010 at 11:24 AM, Sachin Dole sachin.d...@gmail.comwrote: so, it looks like i have to get Git and use git to download sources... and it looks like i might have to download all the 2.1 gigs and leave it to my IDE to figure out which exact file i need cuz i dont know which project i need amongst the many projects listed on http://android.git.kernel.org/. Do you know which projects I really need if i needed the API source code for developing applications for the android platform? Thank you On Tue, Dec 7, 2010 at 1:42 AM, Bob Kerns r...@acm.org wrote: You know, those of us who normally develop with Windows would certainly appreciate a nice .zip file of at least the .java sources. It doesn't have to be buildable, or even complete to every last obscure file. Just something similar to how Sun/Oracle provide src.zip. Yes, I can fire up a virtual machine or Amazon EC2 instance, and make my own. In fact, I'm loading the sources into an Amazon EC2 instance right now, but it's a lot more time consuming than it needs to be -- and there are a lot of us Windows-using developers out here, believe it or not! On Dec 6, 8:48 pm, Xavier Ducrohet x...@android.com wrote: http://source.android.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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Benats Guillaume . -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to create executable file with linking static library?
On Feb 4, 2010 4:09 AM, bluestar bluestar8...@gmail.com wrote: Dear Sir: I have a static library: libhello.a and I want to create a executable file that link with this static library: libhello.a I put this static library under /out/target/product/generic/obj/STATIC_LIBRARIES/ libhello_intermediates/ and make my executable file, but failed It shows error message: make: *** No rule to make target `NOTICE-TARGET-STATIC_LIBRARIES- libhello'. Stop. How to fix this issue? (Below is Android.mk of executable file) Thanks!!! //-// LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE_PATH := $(TARGET_OUT)/bin LOCAL_SRC_FILES:= MyMain.c LOCAL_SHARED_LIBRARIES := libcutils libc LOCAL_STATIC_LIBRARIES := libhello LOCAL_MODULE := myhello include $(BUILD_EXECUTABLE) //-// BR, Alan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en