[android-developers] Re: select (mac) query problem.
Why I am getting this exception? RoomSuffix is an int. Then why I got error when I execute suf = c45.getInt(c45.getColumnIndex(RoomSuffix)); Thanks On Nov 29, 11:55 am, pramod.deore deore.pramo...@gmail.com wrote: Hi, I want to retrieve int value from cursor Cursor c = sampleDB.rawQuery(select max(RoomSuffix)from RoomTable,null); and here RoomSuffix is an int, but when I tried to retrieve value as if (c != null ) { if (c.moveToFirst()) { do { System.out.println (Inside do); System.out.println (c.getColumnCount()); //here i get 1 suf = c.getInt(c.getColumnIndex(RoomSuffix));// here it throws Exception } while (c.moveToNext()); } } and logcat output is 11-29 12:07:28.835: ERROR/CursorWindow(956): Bad request for field slot 0,-1. numRows = 1, numColumns = 1 11-29 12:07:28.843: WARN/System.err(956): java.lang.IllegalStateException: get field slot from row 0 col -1 failed 11-29 12:07:28.894: WARN/System.err(956): at android.database.CursorWindow.getLong_native(Native Method) 11-29 12:07:28.904: WARN/System.err(956): at android.database.CursorWindow.getInt(CursorWindow.java:434) 11-29 12:07:28.925: WARN/System.err(956): at android.database.AbstractWindowedCursor.getInt(AbstractWindowedCursor.java: 93) 11-29 12:07:28.925: WARN/System.err(956): at com.monarch.home.AddRoom.checkRoomExist(AddRoom.java:110) 11-29 12:07:28.944: WARN/System.err(956): at com.monarch.home.AddRoom.insertToRoomTable(AddRoom.java:142) 11-29 12:07:28.954: WARN/System.err(956): at com.monarch.home.AddRoom$1.onItemClick(AddRoom.java:74) 11-29 12:07:28.966: WARN/System.err(956): at android.widget.AdapterView.performItemClick(AdapterView.java:284) 11-29 12:07:28.974: WARN/System.err(956): at android.widget.ListView.performItemClick(ListView.java:3285) 11-29 12:07:28.974: WARN/System.err(956): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1640) 11-29 12:07:28.996: WARN/System.err(956): at android.os.Handler.handleCallback(Handler.java:587) 11-29 12:07:29.005: WARN/System.err(956): at android.os.Handler.dispatchMessage(Handler.java:92) 11-29 12:07:29.005: WARN/System.err(956): at android.os.Looper.loop(Looper.java:123) 11-29 12:07:29.013: WARN/System.err(956): at android.app.ActivityThread.main(ActivityThread.java:4363) 11-29 12:07:29.027: WARN/System.err(956): at java.lang.reflect.Method.invokeNative(Native Method) 11-29 12:07:29.035: WARN/System.err(956): at java.lang.reflect.Method.invoke(Method.java:521) 11-29 12:07:29.044: WARN/System.err(956): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:860) 11-29 12:07:29.053: WARN/System.err(956): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 11-29 12:07:29.053: WARN/System.err(956): at dalvik.system.NativeStart.main(Native Method) -- 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: Simultaneously debugging multiple android applications and components
Hello Elvis, I think it will be easier for you if you use printf debugging, as you can open several adb sessions .. and use logcat with different filters. Or write to your own file the content of the variables. I have no idea whether you can debug multiple components at once. Good luck ! Frank On 27 Nov., 16:43, Elvis Dowson elvis.dow...@gmail.com wrote: Hi, I need to be able to simultaneously debug multiple components from the android-2.2.1 repo, in order to troubleshoot a wifi restart issue that I'm facing that is being discussed on the following thread: http://groups.google.com/group/android-porting/browse_thread/thread/e... I have managed to setup and configure abd over ethernet and have documented the steps here: http://web.me.com/elvis.dowson/Technote/Android_Technotes/Entries/201... In order to troubleshoot the wifi restart issue, I need to debug and monitor the following applications and components simultaneously: 1. external/wpa_supplicant_6 2. frameworks/base ... WifiService.java 3. frameworks/base ... WifiStateTracker.java 4. frameworks/base ... WifiManager.java I've created an Eclipse project for the entire android-2.2.1 repo, and I would like to know what I should do to simultaneously debug the above four applications and components, so that I can select a bunch of variables from them and monitor them as I perform steps on the target device. Is this possible? Elvis Dowson -- 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: Unit Testing - Activity shutdown
Thanks for the response. In my test harness, I do 'button.performClick()', which itself calls activity.finish(). According to docs... If an activity is paused or stopped, the system can drop it from memory either by asking it to finish (calling its finish() method), or simply killing its process. So I would expect onDestroy(). I'm going to trace through (without the test harness) and see what actually happens. There still remains the question - how do I know onPause() was called? Ideally I need a callback, or a way of querying the activity for its state. Any help appreciated Ian Hunter On Nov 28, 9:41 pm, Frank Weiss fewe...@gmail.com wrote: Chances are what you mean by activity exits is not in line with the Android activity lifecycle. Why do you think that the onPause() callback is not sufficient in this case? -- 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] can we upgrade phone from 2.1 to 2.2
If by Galaxy 3 you mean Galaxy S - Samsung started rolling out updates to 2.2 recently. The exact dates are country-specific - I received mine in Russia on November 24 - but it's ongoing. -- Kostya 29.11.2010 9:41, Atik пишет: hello all, i am planning to buy galaxy 3, which is having 2.1 eclairs sdk. so after few days can we update the mobile sdk versions to the new versions??? or we have to use 2.1 only for lifetime. pls suggest me android phone. -- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.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] Re: select (mac) query problem.
When I tried this System.out.println (Column index is+c45.getColumnIndex(RoomSuffix)); then it prints -1. It means column doesn't exist? But I have created table as sampleDB.execSQL(CREATE TABLE IF NOT EXISTS + ROOM_TABLE_NAME + (RoomID integer primary key autoincrement,RoomName VARCHAR,RoomSuffix integer);); Then why it say that column is not exist. On Nov 29, 1:15 pm, pramod.deore deore.pramo...@gmail.com wrote: Why I am getting this exception? RoomSuffix is an int. Then why I got error when I execute suf = c45.getInt(c45.getColumnIndex(RoomSuffix)); Thanks On Nov 29, 11:55 am, pramod.deore deore.pramo...@gmail.com wrote: Hi, I want to retrieve int value from cursor Cursor c = sampleDB.rawQuery(select max(RoomSuffix)from RoomTable,null); and here RoomSuffix is an int, but when I tried to retrieve value as if (c != null ) { if (c.moveToFirst()) { do { System.out.println (Inside do); System.out.println (c.getColumnCount()); //here i get 1 suf = c.getInt(c.getColumnIndex(RoomSuffix));// here it throws Exception } while (c.moveToNext()); } } and logcat output is 11-29 12:07:28.835: ERROR/CursorWindow(956): Bad request for field slot 0,-1. numRows = 1, numColumns = 1 11-29 12:07:28.843: WARN/System.err(956): java.lang.IllegalStateException: get field slot from row 0 col -1 failed 11-29 12:07:28.894: WARN/System.err(956): at android.database.CursorWindow.getLong_native(Native Method) 11-29 12:07:28.904: WARN/System.err(956): at android.database.CursorWindow.getInt(CursorWindow.java:434) 11-29 12:07:28.925: WARN/System.err(956): at android.database.AbstractWindowedCursor.getInt(AbstractWindowedCursor.java: 93) 11-29 12:07:28.925: WARN/System.err(956): at com.monarch.home.AddRoom.checkRoomExist(AddRoom.java:110) 11-29 12:07:28.944: WARN/System.err(956): at com.monarch.home.AddRoom.insertToRoomTable(AddRoom.java:142) 11-29 12:07:28.954: WARN/System.err(956): at com.monarch.home.AddRoom$1.onItemClick(AddRoom.java:74) 11-29 12:07:28.966: WARN/System.err(956): at android.widget.AdapterView.performItemClick(AdapterView.java:284) 11-29 12:07:28.974: WARN/System.err(956): at android.widget.ListView.performItemClick(ListView.java:3285) 11-29 12:07:28.974: WARN/System.err(956): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1640) 11-29 12:07:28.996: WARN/System.err(956): at android.os.Handler.handleCallback(Handler.java:587) 11-29 12:07:29.005: WARN/System.err(956): at android.os.Handler.dispatchMessage(Handler.java:92) 11-29 12:07:29.005: WARN/System.err(956): at android.os.Looper.loop(Looper.java:123) 11-29 12:07:29.013: WARN/System.err(956): at android.app.ActivityThread.main(ActivityThread.java:4363) 11-29 12:07:29.027: WARN/System.err(956): at java.lang.reflect.Method.invokeNative(Native Method) 11-29 12:07:29.035: WARN/System.err(956): at java.lang.reflect.Method.invoke(Method.java:521) 11-29 12:07:29.044: WARN/System.err(956): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:860) 11-29 12:07:29.053: WARN/System.err(956): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 11-29 12:07:29.053: WARN/System.err(956): at dalvik.system.NativeStart.main(Native Method) -- 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: Localization: no compression... huge APK...
The reason for the big difference is that strings in res/values are stored uncompressed in UTF16. They can then be memory mapped. (The Android dev team later said if would have been better if they went with UTF8 for size) Interesting, thanks. Perhaps you could leave one language (the most used) in res/values for safety, speed, and the generations of the IDs. And then create something that will load strings using the same IDs from xml for other languages. That's a great idea but it means an extra 130k just to have English in res/ and the app doesn't go on SD (service,widgets) so I can't justify those extra bytes just for ease of building I think. I'm currently leaning towards parsing the xml files in Perl as a pre- build step and replacing R.string.NAME in the java source with the ints. I'll leave the values-xxx directories in res for eclipse building and move them to assets/ as part of the build (I copy everything to /tmp for release building anyway) The most time consuming is going to be replacing getString() with MyRes.getString() and pulling all the @string specs in layouts into code. Pent -- 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: select (mac) query problem.
That's because your query has an expression, max(RoomSuffix). The result (cursor) also uses that expression as the column name, and not just RoomSuffix. You could do one of the following to fix this: - Call c.getInt(1) without c.getColumnIndex, since you know there is only one column. - Rewrite the query as SELECT MAX(RoomSuffix) AS MAX_SUFFIX FROM RoomTable This assigns a known column name (MAX_SUFFIX) to the expression. You then can call getColumnIndex(MAX_SUFFIX). - Use SQLiteStatement.simpleQueryForLong with your query: public long simpleQueryForLong () Since: API Level 1 Execute a statement that returns a 1 by 1 table with a numeric value. For example, SELECT COUNT(*) FROM table; Returns The result of the query. -- Kostya 29.11.2010 11:15, pramod.deore пишет: Why I am getting this exception? RoomSuffix is an int. Then why I got error when I execute suf = c45.getInt(c45.getColumnIndex(RoomSuffix)); Thanks On Nov 29, 11:55 am, pramod.deoredeore.pramo...@gmail.com wrote: Hi, I want to retrieve int value from cursor Cursor c = sampleDB.rawQuery(select max(RoomSuffix)from RoomTable,null); and here RoomSuffix is an int, but when I tried to retrieve value as if (c != null ) { if (c.moveToFirst()) { do { System.out.println (Inside do); System.out.println (c.getColumnCount());//here i get 1 suf = c.getInt(c.getColumnIndex(RoomSuffix));// here it throws Exception } while (c.moveToNext()); } } and logcat output is 11-29 12:07:28.835: ERROR/CursorWindow(956): Bad request for field slot 0,-1. numRows = 1, numColumns = 1 11-29 12:07:28.843: WARN/System.err(956): java.lang.IllegalStateException: get field slot from row 0 col -1 failed 11-29 12:07:28.894: WARN/System.err(956): at android.database.CursorWindow.getLong_native(Native Method) 11-29 12:07:28.904: WARN/System.err(956): at android.database.CursorWindow.getInt(CursorWindow.java:434) 11-29 12:07:28.925: WARN/System.err(956): at android.database.AbstractWindowedCursor.getInt(AbstractWindowedCursor.java: 93) 11-29 12:07:28.925: WARN/System.err(956): at com.monarch.home.AddRoom.checkRoomExist(AddRoom.java:110) 11-29 12:07:28.944: WARN/System.err(956): at com.monarch.home.AddRoom.insertToRoomTable(AddRoom.java:142) 11-29 12:07:28.954: WARN/System.err(956): at com.monarch.home.AddRoom$1.onItemClick(AddRoom.java:74) 11-29 12:07:28.966: WARN/System.err(956): at android.widget.AdapterView.performItemClick(AdapterView.java:284) 11-29 12:07:28.974: WARN/System.err(956): at android.widget.ListView.performItemClick(ListView.java:3285) 11-29 12:07:28.974: WARN/System.err(956): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1640) 11-29 12:07:28.996: WARN/System.err(956): at android.os.Handler.handleCallback(Handler.java:587) 11-29 12:07:29.005: WARN/System.err(956): at android.os.Handler.dispatchMessage(Handler.java:92) 11-29 12:07:29.005: WARN/System.err(956): at android.os.Looper.loop(Looper.java:123) 11-29 12:07:29.013: WARN/System.err(956): at android.app.ActivityThread.main(ActivityThread.java:4363) 11-29 12:07:29.027: WARN/System.err(956): at java.lang.reflect.Method.invokeNative(Native Method) 11-29 12:07:29.035: WARN/System.err(956): at java.lang.reflect.Method.invoke(Method.java:521) 11-29 12:07:29.044: WARN/System.err(956): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:860) 11-29 12:07:29.053: WARN/System.err(956): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 11-29 12:07:29.053: WARN/System.err(956): at dalvik.system.NativeStart.main(Native Method) -- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.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] Re: Localization: no compression... huge APK...
On Nov 28, 1:29 pm, DanH danhi...@ieee.org wrote: You don't have to generate your own resource IDs. Just don't use IDs. Nothing REQUIRES you to use IDs. Slightly off topic, but that was an absolute which I'm pretty sure is incorrect. The constructor for android.app.Notification wants a resource ID if you want to make a notification to put in the status bar. (Yes, I know, it's a drawable, hence the off topic, but I don't see away around it, if you have one, I'd be very interested in hearing about it.) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How is CallLog updated when Contact information changed?
Hi, I want to know the approach android followed for CallLog updation, when ever there is a change in Contact's Data. And can any body suggest the code in which it is being handled in Android source code? Thanks in advance!! -- 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: Localization: no compression... huge APK...
Try looking at the Android source code, look for the resource handling parts. Maybe you can copy some parts. On Nov 29, 9:35 am, Pent tas...@dinglisch.net wrote: The reason for the big difference is that strings in res/values are stored uncompressed in UTF16. They can then be memory mapped. (The Android dev team later said if would have been better if they went with UTF8 for size) Interesting, thanks. Perhaps you could leave one language (the most used) in res/values for safety, speed, and the generations of the IDs. And then create something that will load strings using the same IDs from xml for other languages. That's a great idea but it means an extra 130k just to have English in res/ and the app doesn't go on SD (service,widgets) so I can't justify those extra bytes just for ease of building I think. I'm currently leaning towards parsing the xml files in Perl as a pre- build step and replacing R.string.NAME in the java source with the ints. I'll leave the values-xxx directories in res for eclipse building and move them to assets/ as part of the build (I copy everything to /tmp for release building anyway) The most time consuming is going to be replacing getString() with MyRes.getString() and pulling all the @string specs in layouts into code. Pent -- 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: select (mac) query problem.
Thanks Kostya . It works On Nov 29, 1:36 pm, Kostya Vasilyev kmans...@gmail.com wrote: That's because your query has an expression, max(RoomSuffix). The result (cursor) also uses that expression as the column name, and not just RoomSuffix. You could do one of the following to fix this: - Call c.getInt(1) without c.getColumnIndex, since you know there is only one column. - Rewrite the query as SELECT MAX(RoomSuffix) AS MAX_SUFFIX FROM RoomTable This assigns a known column name (MAX_SUFFIX) to the expression. You then can call getColumnIndex(MAX_SUFFIX). - Use SQLiteStatement.simpleQueryForLong with your query: public long simpleQueryForLong () Since: API Level 1 Execute a statement that returns a 1 by 1 table with a numeric value. For example, SELECT COUNT(*) FROM table; Returns The result of the query. -- Kostya 29.11.2010 11:15, pramod.deore пишет: Why I am getting this exception? RoomSuffix is an int. Then why I got error when I execute suf = c45.getInt(c45.getColumnIndex(RoomSuffix)); Thanks On Nov 29, 11:55 am, pramod.deoredeore.pramo...@gmail.com wrote: Hi, I want to retrieve int value from cursor Cursor c = sampleDB.rawQuery(select max(RoomSuffix)from RoomTable,null); and here RoomSuffix is an int, but when I tried to retrieve value as if (c != null ) { if (c.moveToFirst()) { do { System.out.println (Inside do); System.out.println (c.getColumnCount()); //here i get 1 suf = c.getInt(c.getColumnIndex(RoomSuffix));// here it throws Exception } while (c.moveToNext()); } } and logcat output is 11-29 12:07:28.835: ERROR/CursorWindow(956): Bad request for field slot 0,-1. numRows = 1, numColumns = 1 11-29 12:07:28.843: WARN/System.err(956): java.lang.IllegalStateException: get field slot from row 0 col -1 failed 11-29 12:07:28.894: WARN/System.err(956): at android.database.CursorWindow.getLong_native(Native Method) 11-29 12:07:28.904: WARN/System.err(956): at android.database.CursorWindow.getInt(CursorWindow.java:434) 11-29 12:07:28.925: WARN/System.err(956): at android.database.AbstractWindowedCursor.getInt(AbstractWindowedCursor.java: 93) 11-29 12:07:28.925: WARN/System.err(956): at com.monarch.home.AddRoom.checkRoomExist(AddRoom.java:110) 11-29 12:07:28.944: WARN/System.err(956): at com.monarch.home.AddRoom.insertToRoomTable(AddRoom.java:142) 11-29 12:07:28.954: WARN/System.err(956): at com.monarch.home.AddRoom$1.onItemClick(AddRoom.java:74) 11-29 12:07:28.966: WARN/System.err(956): at android.widget.AdapterView.performItemClick(AdapterView.java:284) 11-29 12:07:28.974: WARN/System.err(956): at android.widget.ListView.performItemClick(ListView.java:3285) 11-29 12:07:28.974: WARN/System.err(956): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1640) 11-29 12:07:28.996: WARN/System.err(956): at android.os.Handler.handleCallback(Handler.java:587) 11-29 12:07:29.005: WARN/System.err(956): at android.os.Handler.dispatchMessage(Handler.java:92) 11-29 12:07:29.005: WARN/System.err(956): at android.os.Looper.loop(Looper.java:123) 11-29 12:07:29.013: WARN/System.err(956): at android.app.ActivityThread.main(ActivityThread.java:4363) 11-29 12:07:29.027: WARN/System.err(956): at java.lang.reflect.Method.invokeNative(Native Method) 11-29 12:07:29.035: WARN/System.err(956): at java.lang.reflect.Method.invoke(Method.java:521) 11-29 12:07:29.044: WARN/System.err(956): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:860) 11-29 12:07:29.053: WARN/System.err(956): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 11-29 12:07:29.053: WARN/System.err(956): at dalvik.system.NativeStart.main(Native Method) -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.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] Licensing Server and free apps
Hallo! I have the following usecase: I am developing an application, that will be commercial once it is done. Currently it is unfinished but I want a beta version to be offered to a list of selected users. Those users should be able to download the application using the market for free. Going throught the tutorial of the licensing server I found the following: Licensing is currently for paid apps only, since free apps are considered licensed for all users. If your application is already published as free, you won't be able to upload a new version that uses licensing. Is it possible to implement licensing in the application, upload it to the market for free and offer it to a list of users, whose gmail address I know? Other users should not see the application or at least should not be able to run it. Thanks in advance for your help Patrick -- 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 set the Foreground for the frames ?
hai, i am new buddy for android platform . I want to setForeground image for the callee layout in call screen of android. To do this in layout xml file i have changed that callee frames as FrameLayout and then by getting ids of Framelayout i am setting foreground for each callee lines. it's working fine for only 2 calls (at max i can make 3 calls at the same time by putting other two active calls in hold) , when ever i make a third call lot of contravention happening. so, my question is without changing layout xml files by using any animation or opacity we can change the frames foreground ? Is it possible , plz give me example if possible. (note : if i press the menu options then also the opacity must shown for frames ) if it is possible plz , suggest me the way how can i make this possible ? thanks in advance... -- 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: select (mac) query problem.
Just curious - which of the three possible fixes did you apply? 29.11.2010 12:17, pramod.deore пишет: Thanks Kostya . It works On Nov 29, 1:36 pm, Kostya Vasilyevkmans...@gmail.com wrote: That's because your query has an expression, max(RoomSuffix). The result (cursor) also uses that expression as the column name, and not just RoomSuffix. You could do one of the following to fix this: - Call c.getInt(1) without c.getColumnIndex, since you know there is only one column. - Rewrite the query as SELECT MAX(RoomSuffix) AS MAX_SUFFIX FROM RoomTable This assigns a known column name (MAX_SUFFIX) to the expression. You then can call getColumnIndex(MAX_SUFFIX). - Use SQLiteStatement.simpleQueryForLong with your query: public long simpleQueryForLong () Since: API Level 1 Execute a statement that returns a 1 by 1 table with a numeric value. For example, SELECT COUNT(*) FROM table; Returns The result of the query. -- Kostya 29.11.2010 11:15, pramod.deore пишет: Why I am getting this exception? RoomSuffix is an int. Then why I got error when I execute suf = c45.getInt(c45.getColumnIndex(RoomSuffix)); Thanks On Nov 29, 11:55 am, pramod.deoredeore.pramo...@gmail.comwrote: Hi, I want to retrieve int value from cursor Cursor c = sampleDB.rawQuery(select max(RoomSuffix)from RoomTable,null); and here RoomSuffix is an int, but when I tried to retrieve value as if (c != null ) { if (c.moveToFirst()) { do { System.out.println (Inside do); System.out.println (c.getColumnCount());//here i get 1 suf = c.getInt(c.getColumnIndex(RoomSuffix));// here it throws Exception } while (c.moveToNext()); } } and logcat output is 11-29 12:07:28.835: ERROR/CursorWindow(956): Bad request for field slot 0,-1. numRows = 1, numColumns = 1 11-29 12:07:28.843: WARN/System.err(956): java.lang.IllegalStateException: get field slot from row 0 col -1 failed 11-29 12:07:28.894: WARN/System.err(956): at android.database.CursorWindow.getLong_native(Native Method) 11-29 12:07:28.904: WARN/System.err(956): at android.database.CursorWindow.getInt(CursorWindow.java:434) 11-29 12:07:28.925: WARN/System.err(956): at android.database.AbstractWindowedCursor.getInt(AbstractWindowedCursor.java: 93) 11-29 12:07:28.925: WARN/System.err(956): at com.monarch.home.AddRoom.checkRoomExist(AddRoom.java:110) 11-29 12:07:28.944: WARN/System.err(956): at com.monarch.home.AddRoom.insertToRoomTable(AddRoom.java:142) 11-29 12:07:28.954: WARN/System.err(956): at com.monarch.home.AddRoom$1.onItemClick(AddRoom.java:74) 11-29 12:07:28.966: WARN/System.err(956): at android.widget.AdapterView.performItemClick(AdapterView.java:284) 11-29 12:07:28.974: WARN/System.err(956): at android.widget.ListView.performItemClick(ListView.java:3285) 11-29 12:07:28.974: WARN/System.err(956): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1640) 11-29 12:07:28.996: WARN/System.err(956): at android.os.Handler.handleCallback(Handler.java:587) 11-29 12:07:29.005: WARN/System.err(956): at android.os.Handler.dispatchMessage(Handler.java:92) 11-29 12:07:29.005: WARN/System.err(956): at android.os.Looper.loop(Looper.java:123) 11-29 12:07:29.013: WARN/System.err(956): at android.app.ActivityThread.main(ActivityThread.java:4363) 11-29 12:07:29.027: WARN/System.err(956): at java.lang.reflect.Method.invokeNative(Native Method) 11-29 12:07:29.035: WARN/System.err(956): at java.lang.reflect.Method.invoke(Method.java:521) 11-29 12:07:29.044: WARN/System.err(956): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:860) 11-29 12:07:29.053: WARN/System.err(956): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 11-29 12:07:29.053: WARN/System.err(956): at dalvik.system.NativeStart.main(Native Method) -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.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] Re: Unit Testing - Activity shutdown
OK. Just run up the same app, press exit button and I get a call to onStop(), then onDestroy(). That, I assume is what happens on the finish() method. Notice no call to onPause() :-\ So, it looks like the test harness has a different behaviour. A temporary, poor solution has been to create an interval variable which gets set on state transitions (onPause(), onCreate() etc.), and then query that variable in my test harness. Then I use 'assertTrue(state != RUNNING)'. Not good, but I can move on for now. Any better solutions, or insights appreciated. Thanks Ian Hunter On Nov 29, 8:20 am, Ian ian.fawcett.hun...@gmail.com wrote: Thanks for the response. In my test harness, I do 'button.performClick()', which itself calls activity.finish(). According to docs... If an activity is paused or stopped, the system can drop it from memory either by asking it to finish (calling its finish() method), or simply killing its process. So I would expect onDestroy(). I'm going to trace through (without the test harness) and see what actually happens. There still remains the question - how do I know onPause() was called? Ideally I need a callback, or a way of querying the activity for its state. Any help appreciated Ian Hunter On Nov 28, 9:41 pm, Frank Weiss fewe...@gmail.com wrote: Chances are what you mean by activity exits is not in line with the Android activity lifecycle. Why do you think that the onPause() callback is not sufficient in this case? -- 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 we upgrade phone from 2.1 to 2.2
means u mean to say k user can update there SDK . i was thinking that once any one purchases a cell phone with a particular SDK , that will remain unchaged and we cant update the same. means i was thinking that if a person bought a android 2.1 eclairs device then he will be using the same device without any updates for lifetime with the same sdk. please clarify . i know i am wrong, but need some more info about it. Thanks Atik On Nov 29, 1:25 pm, Kostya Vasilyev kmans...@gmail.com wrote: If by Galaxy 3 you mean Galaxy S - Samsung started rolling out updates to 2.2 recently. The exact dates are country-specific - I received mine in Russia on November 24 - but it's ongoing. -- Kostya 29.11.2010 9:41, Atik пишет: hello all, i am planning to buy galaxy 3, which is having 2.1 eclairs sdk. so after few days can we update the mobile sdk versions to the new versions??? or we have to use 2.1 only for lifetime. pls suggest me android phone. -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.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] Re: select (mac) query problem.
This one_ - Rewrite the query as SELECT MAX(RoomSuffix) AS MAX_SUFFIX FROM RoomTable This assigns a known column name (MAX_SUFFIX) to the expression. You then can call getColumnIndex(MAX_SUFFIX). On Nov 29, 2:28 pm, Kostya Vasilyev kmans...@gmail.com wrote: Just curious - which of the three possible fixes did you apply? 29.11.2010 12:17, pramod.deore пишет: Thanks Kostya . It works On Nov 29, 1:36 pm, Kostya Vasilyevkmans...@gmail.com wrote: That's because your query has an expression, max(RoomSuffix). The result (cursor) also uses that expression as the column name, and not just RoomSuffix. You could do one of the following to fix this: - Call c.getInt(1) without c.getColumnIndex, since you know there is only one column. - Rewrite the query as SELECT MAX(RoomSuffix) AS MAX_SUFFIX FROM RoomTable This assigns a known column name (MAX_SUFFIX) to the expression. You then can call getColumnIndex(MAX_SUFFIX). - Use SQLiteStatement.simpleQueryForLong with your query: public long simpleQueryForLong () Since: API Level 1 Execute a statement that returns a 1 by 1 table with a numeric value. For example, SELECT COUNT(*) FROM table; Returns The result of the query. -- Kostya 29.11.2010 11:15, pramod.deore пишет: Why I am getting this exception? RoomSuffix is an int. Then why I got error when I execute suf = c45.getInt(c45.getColumnIndex(RoomSuffix)); Thanks On Nov 29, 11:55 am, pramod.deoredeore.pramo...@gmail.com wrote: Hi, I want to retrieve int value from cursor Cursor c = sampleDB.rawQuery(select max(RoomSuffix)from RoomTable,null); and here RoomSuffix is an int, but when I tried to retrieve value as if (c != null ) { if (c.moveToFirst()) { do { System.out.println (Inside do); System.out.println (c.getColumnCount()); //here i get 1 suf = c.getInt(c.getColumnIndex(RoomSuffix));// here it throws Exception } while (c.moveToNext()); } } and logcat output is 11-29 12:07:28.835: ERROR/CursorWindow(956): Bad request for field slot 0,-1. numRows = 1, numColumns = 1 11-29 12:07:28.843: WARN/System.err(956): java.lang.IllegalStateException: get field slot from row 0 col -1 failed 11-29 12:07:28.894: WARN/System.err(956): at android.database.CursorWindow.getLong_native(Native Method) 11-29 12:07:28.904: WARN/System.err(956): at android.database.CursorWindow.getInt(CursorWindow.java:434) 11-29 12:07:28.925: WARN/System.err(956): at android.database.AbstractWindowedCursor.getInt(AbstractWindowedCursor.java: 93) 11-29 12:07:28.925: WARN/System.err(956): at com.monarch.home.AddRoom.checkRoomExist(AddRoom.java:110) 11-29 12:07:28.944: WARN/System.err(956): at com.monarch.home.AddRoom.insertToRoomTable(AddRoom.java:142) 11-29 12:07:28.954: WARN/System.err(956): at com.monarch.home.AddRoom$1.onItemClick(AddRoom.java:74) 11-29 12:07:28.966: WARN/System.err(956): at android.widget.AdapterView.performItemClick(AdapterView.java:284) 11-29 12:07:28.974: WARN/System.err(956): at android.widget.ListView.performItemClick(ListView.java:3285) 11-29 12:07:28.974: WARN/System.err(956): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1640) 11-29 12:07:28.996: WARN/System.err(956): at android.os.Handler.handleCallback(Handler.java:587) 11-29 12:07:29.005: WARN/System.err(956): at android.os.Handler.dispatchMessage(Handler.java:92) 11-29 12:07:29.005: WARN/System.err(956): at android.os.Looper.loop(Looper.java:123) 11-29 12:07:29.013: WARN/System.err(956): at android.app.ActivityThread.main(ActivityThread.java:4363) 11-29 12:07:29.027: WARN/System.err(956): at java.lang.reflect.Method.invokeNative(Native Method) 11-29 12:07:29.035: WARN/System.err(956): at java.lang.reflect.Method.invoke(Method.java:521) 11-29 12:07:29.044: WARN/System.err(956): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:860) 11-29 12:07:29.053: WARN/System.err(956): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 11-29 12:07:29.053: WARN/System.err(956): at dalvik.system.NativeStart.main(Native Method) -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- Kostya Vasilyev -- WiFi Manager + pretty widget
[android-developers] Re: Localization: no compression... huge APK...
android.app.Notification wants a resource ID if you want to make a notification to put in the status bar. (Yes, I know, it's a drawable, hence the off topic, but I don't see away around it, if you have one, I'd be very interested in hearing about it.) I put in a feature request to allow a Drawable for that a few weeks ago. http://code.google.com/p/android/issues/detail?id=12302 Feel free to * it. Pent -- 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: Questions about ThreadSafeHttpClient connection
No. Threads call a certain getResponse() function which does a httpclient.execute() call. We do a response.getEntity().getContent() and pass the InputStream to the caller. So, you see, the HttpEntity is not handed over to anyone as is. From the Http Components documentation, I gathered that even if the stream is read till the end, the connection would be released to the manager. Is this correct? So if the caller of getResponse() is passing this InputStream to a parser and a parser reads the entire Stream and closes it, the connection should be realeased. Is this how it works? Thanks for your time. -- 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: can we upgrade phone from 2.1 to 2.2
There is no SDK on the phone. SDK is what you use to develop applications - on a desktop computer. Phones (and other devices) have firmware, which is the Android platform, of a particular version, that is made to work on that particular phone model, sometimes with new functionality (HTC Sense, MOTOBLUR, Samsung TouchWiz, etc.) Some manufacturers release firmware updates for their Android phones, some even do it more or less on time. Some don't. Some examples: - HTC was late with their 1.6 to 2.1 update for the Hero by about six months. - Samsung released 2.1 to 2.2 update for the Galaxy S only about two months late. - Motorola is already some 3 months late with a 2.2 update for the Milestone, still unreleased. Since you mentioned the Samsung Galaxy in your original message, I already provided information specifically about that phone. -- Kostya 29.11.2010 13:03, Atik пишет: means u mean to say k user can update there SDK . i was thinking that once any one purchases a cell phone with a particular SDK , that will remain unchaged and we cant update the same. means i was thinking that if a person bought a android 2.1 eclairs device then he will be using the same device without any updates for lifetime with the same sdk. please clarify . i know i am wrong, but need some more info about it. Thanks Atik On Nov 29, 1:25 pm, Kostya Vasilyevkmans...@gmail.com wrote: If by Galaxy 3 you mean Galaxy S - Samsung started rolling out updates to 2.2 recently. The exact dates are country-specific - I received mine in Russia on November 24 - but it's ongoing. -- Kostya 29.11.2010 9:41, Atik пишет: hello all, i am planning to buy galaxy 3, which is having 2.1 eclairs sdk. so after few days can we update the mobile sdk versions to the new versions??? or we have to use 2.1 only for lifetime. pls suggest me android phone. -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.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] Re: select (mac) query problem.
Hi, But there is a problem . getColumnIndex(MAX_SUFFIX) doesn't return the highest integer. Here is in short what I am doing:- I have at table which have 3 columns:1. RoomId, 2. RoomaName 3. RoomSuffix If suppose in database there are following data RoomID RoomName 1 Hall 2 Kitchen and suppose user again add Hall then in that case RoomSuffix must have to increase by 1. RoomID RoomName RoomSuffix 1 Hall 0 2 Kitchen0 3 Hall 1 4 Hall 2 Here I had created a table as public void insertToRoomTable(String roomName) { try { sampleDB.execSQL(CREATE TABLE IF NOT EXISTS + ROOM_TABLE_NAME + (RoomID integer primary key autoincrement,RoomName VARCHAR,RoomSuffix integer);); boolean roomExist = checkRoomExist(roomName); System.out.println (!...@#!@#...@#!@#+roomExist); System.out.println (Here value of suf +suf); sampleDB.execSQL(INSERT INTO + ROOM_TABLE_NAME + Values (null,'+roomName+','+suf+');); } catch (Exception e) { e.printStackTrace(); } } public boolean checkRoomExist(String name) { Cursor c = sampleDB.rawQuery(SELECT RoomName FROM +ROOM_TABLE_NAME , null); if (c != null ) { System.out.println (%%%+c.getCount()); if (c.moveToFirst()) { do { rname = c.getString(c.getColumnIndex(RoomName)); System.out.println (name is +name); System.out.println (name is +rname); if (name.equalsIgnoreCase(rname)) { System.out.println (Room already exist); //String str = select max(RoomSuffix) from RoomTable; Cursor c4 = sampleDB.rawQuery(SELECT MAX(RoomSuffix) AS MAX_SUFFIX FROM RoomTable,null); if (c4 != null ) { if (c4.moveToFirst()) { do { System.out.println (***); System.out.println (c4.getColumnIndex(MAX_SUFFIX)); suf = c4.getColumnIndex(MAX_SUFFIX)+1; System.out.println (+suf); } while (c4.moveToNext()); return true; } } } } while (c.moveToNext()); } } c.close(); return false; } But here is problem is that If there is a record say like 1Hall 0 2Hall 1 Upto this ok, But when add another record for Hall then also it enter it as 3Hall 1 Means every time Cursor c4 = sampleDB.rawQuery(SELECT MAX(RoomSuffix) AS MAX_SUFFIX FROM RoomTable,null); if (c4 != null ) { if (c4.moveToFirst()) { do { System.out.println (***); System.out.println (c4.getColumnIndex(MAX_SUFFIX)); suf = c4.getColumnIndex(MAX_SUFFIX)+1; //Here it always returns 0. System.out.println (+suf); } while (c4.moveToNext()); return true; } } Value of suf = 0. On Nov 29, 3:15 pm, pramod.deore deore.pramo...@gmail.com wrote: This one_ - Rewrite the query as SELECT MAX(RoomSuffix) AS MAX_SUFFIX FROM RoomTable This assigns a known column name (MAX_SUFFIX) to the
Re: [android-developers] Re: select (mac) query problem.
Your code never gets the actual value for MAX_SUFFIX. You're calling getColumnIndex, but never - getInt. I see you tried to fix it by doing +1 on the value - that's a pretty good tip-off that you are doing something wrong. -- Kostya 29.11.2010 13:33, pramod.deore пишет: Hi, But there is a problem . getColumnIndex(MAX_SUFFIX) doesn't return the highest integer. Here is in short what I am doing:- I have at table which have 3 columns:1. RoomId, 2. RoomaName 3. RoomSuffix If suppose in database there are following data RoomID RoomName 1 Hall 2 Kitchen and suppose user again add Hall then in that case RoomSuffix must have to increase by 1. RoomID RoomName RoomSuffix 1 Hall 0 2 Kitchen0 3 Hall 1 4 Hall 2 Here I had created a table as public void insertToRoomTable(String roomName) { try { sampleDB.execSQL(CREATE TABLE IF NOT EXISTS + ROOM_TABLE_NAME + (RoomID integer primary key autoincrement,RoomName VARCHAR,RoomSuffix integer);); boolean roomExist = checkRoomExist(roomName); System.out.println (!...@#!@#...@#!@#+roomExist); System.out.println (Here value of suf +suf); sampleDB.execSQL(INSERT INTO + ROOM_TABLE_NAME + Values (null,'+roomName+','+suf+');); } catch (Exception e) { e.printStackTrace(); } } public boolean checkRoomExist(String name) { Cursor c = sampleDB.rawQuery(SELECT RoomName FROM +ROOM_TABLE_NAME , null); if (c != null ) { System.out.println (%%%+c.getCount()); if (c.moveToFirst()) { do { rname = c.getString(c.getColumnIndex(RoomName)); System.out.println (name is +name); System.out.println (name is +rname); if (name.equalsIgnoreCase(rname)) { System.out.println (Room already exist); //String str = select max(RoomSuffix) from RoomTable; Cursor c4 = sampleDB.rawQuery(SELECT MAX(RoomSuffix) AS MAX_SUFFIX FROM RoomTable,null); if (c4 != null ) { if (c4.moveToFirst()) { do { System.out.println (***); System.out.println (c4.getColumnIndex(MAX_SUFFIX)); suf = c4.getColumnIndex(MAX_SUFFIX)+1; System.out.println (+suf); } while (c4.moveToNext()); return true; } } } } while (c.moveToNext()); } } c.close(); return false; } But here is problem is that If there is a record say like 1Hall 0 2Hall 1 Upto this ok, But when add another record for Hall then also it enter it as 3Hall 1 Means every time Cursor c4 = sampleDB.rawQuery(SELECT MAX(RoomSuffix) AS MAX_SUFFIX FROM RoomTable,null); if (c4 != null ) { if (c4.moveToFirst()) { do { System.out.println (***); System.out.println (c4.getColumnIndex(MAX_SUFFIX)); suf = c4.getColumnIndex(MAX_SUFFIX)+1; //Here it always returns 0. System.out.println (+suf); } while (c4.moveToNext()); return true;
[android-developers] Can we Import contacts in List Preferences
Hi, I am trying to import contacts in the preferences, actually I want that particular code should access a contact which I select and that value needs to be passed to other class or activity in future. For that I need to import contacts in the form of array I suppose. I need to know how I can pass the values in the list form to the preferences. Please help. Thanks in advance for the help I always get at this forum Nishant Bhargava -- 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: select (mac) query problem.
You are right Kpstya after chenging to suf = c4.getInt(c4.getColumnIndex(MAX_SUFFIX))+1; It solve my partial problem . But Now here is new issue arrise which is I also faced when I user SharedPreference. Now the problem is If I have data like 1Hall 0 2Hall 1 3Kitchen 0 4. kitchen 2 5. Hall 3 Here what I want 1Hall 0 2Hall 1 3Kitchen 0 4. kitchen 1 5. Hall 2 On Nov 29, 3:42 pm, Kostya Vasilyev kmans...@gmail.com wrote: Your code never gets the actual value for MAX_SUFFIX. You're calling getColumnIndex, but never - getInt. I see you tried to fix it by doing +1 on the value - that's a pretty good tip-off that you are doing something wrong. -- Kostya 29.11.2010 13:33, pramod.deore пишет: Hi, But there is a problem . getColumnIndex(MAX_SUFFIX) doesn't return the highest integer. Here is in short what I am doing:- I have at table which have 3 columns:1. RoomId, 2. RoomaName 3. RoomSuffix If suppose in database there are following data RoomID RoomName 1 Hall 2 Kitchen and suppose user again add Hall then in that case RoomSuffix must have to increase by 1. RoomID RoomName RoomSuffix 1 Hall 0 2 Kitchen 0 3 Hall 1 4 Hall 2 Here I had created a table as public void insertToRoomTable(String roomName) { try { sampleDB.execSQL(CREATE TABLE IF NOT EXISTS + ROOM_TABLE_NAME + (RoomID integer primary key autoincrement,RoomName VARCHAR,RoomSuffix integer);); boolean roomExist = checkRoomExist(roomName); System.out.println (!...@#!@#...@#!@#+roomExist); System.out.println (Here value of suf +suf); sampleDB.execSQL(INSERT INTO + ROOM_TABLE_NAME + Values (null,'+roomName+','+suf+');); } catch (Exception e) { e.printStackTrace(); } } public boolean checkRoomExist(String name) { Cursor c = sampleDB.rawQuery(SELECT RoomName FROM +ROOM_TABLE_NAME , null); if (c != null ) { System.out.println (%%%+c.getCount()); if (c.moveToFirst()) { do { rname = c.getString(c.getColumnIndex(RoomName)); System.out.println (name is +name); System.out.println (name is +rname); if (name.equalsIgnoreCase(rname)) { System.out.println (Room already exist); //String str = select max(RoomSuffix) from RoomTable; Cursor c4 = sampleDB.rawQuery(SELECT MAX(RoomSuffix) AS MAX_SUFFIX FROM RoomTable,null); if (c4 != null ) { if (c4.moveToFirst()) { do { System.out.println (***); System.out.println (c4.getColumnIndex(MAX_SUFFIX)); suf = c4.getColumnIndex(MAX_SUFFIX)+1; System.out.println (+suf); } while (c4.moveToNext()); return true; } } } } while (c.moveToNext()); } } c.close(); return false; } But here is problem is that If there is a record say like 1 Hall 0 2 Hall 1 Upto this ok, But when add another record for Hall then also it enter it as 3 Hall 1 Means every time Cursor c4 = sampleDB.rawQuery(SELECT MAX(RoomSuffix) AS MAX_SUFFIX FROM RoomTable,null); if (c4 != null ) { if (c4.moveToFirst()) {
Re: [android-developers] Re: select (mac) query problem.
If you want a separate suffix sequence for each room name (if I understand you correctly), change your query for MAX_SUFFIX to filter by room name. SELECT MAX(RoomSuffix) FROM ROOM_TABLE_NAME WHERE RoomName = room name here I recommend you read through a SQL tutorial of some sorts. Here is one: http://www.sqltutorial.org/ -- Kostya 29.11.2010 14:02, pramod.deore пишет: You are right Kpstya after chenging to suf = c4.getInt(c4.getColumnIndex(MAX_SUFFIX))+1; It solve my partial problem . But Now here is new issue arrise which is I also faced when I user SharedPreference. Now the problem is If I have data like 1Hall 0 2Hall 1 3Kitchen 0 4. kitchen 2 5. Hall 3 Here what I want 1Hall 0 2Hall 1 3Kitchen 0 4. kitchen 1 5. Hall 2 On Nov 29, 3:42 pm, Kostya Vasilyevkmans...@gmail.com wrote: Your code never gets the actual value for MAX_SUFFIX. You're calling getColumnIndex, but never - getInt. I see you tried to fix it by doing +1 on the value - that's a pretty good tip-off that you are doing something wrong. -- Kostya 29.11.2010 13:33, pramod.deore пишет: Hi, But there is a problem . getColumnIndex(MAX_SUFFIX) doesn't return the highest integer. Here is in short what I am doing:- I have at table which have 3 columns:1. RoomId, 2. RoomaName 3. RoomSuffix If suppose in database there are following data RoomID RoomName 1 Hall 2 Kitchen and suppose user again add Hall then in that case RoomSuffix must have to increase by 1. RoomID RoomName RoomSuffix 1 Hall 0 2 Kitchen0 3 Hall 1 4 Hall 2 Here I had created a table as public void insertToRoomTable(String roomName) { try { sampleDB.execSQL(CREATE TABLE IF NOT EXISTS + ROOM_TABLE_NAME + (RoomID integer primary key autoincrement,RoomName VARCHAR,RoomSuffix integer);); boolean roomExist = checkRoomExist(roomName); System.out.println (!...@#!@#...@#!@#+roomExist); System.out.println (Here value of suf +suf); sampleDB.execSQL(INSERT INTO + ROOM_TABLE_NAME + Values (null,'+roomName+','+suf+');); } catch (Exception e) { e.printStackTrace(); } } public boolean checkRoomExist(String name) { Cursor c = sampleDB.rawQuery(SELECT RoomName FROM +ROOM_TABLE_NAME , null); if (c != null ) { System.out.println (%%%+c.getCount()); if (c.moveToFirst()) { do { rname = c.getString(c.getColumnIndex(RoomName)); System.out.println (name is +name); System.out.println (name is +rname); if (name.equalsIgnoreCase(rname)) { System.out.println (Room already exist); //String str = select max(RoomSuffix) from RoomTable; Cursor c4 = sampleDB.rawQuery(SELECT MAX(RoomSuffix) AS MAX_SUFFIX FROM RoomTable,null); if (c4 != null ) { if (c4.moveToFirst()) { do { System.out.println (***); System.out.println (c4.getColumnIndex(MAX_SUFFIX)); suf = c4.getColumnIndex(MAX_SUFFIX)+1; System.out.println (+suf); } while (c4.moveToNext()); return true; } } } } while (c.moveToNext()); } } c.close(); return false; } But here is problem is that If there is a record say like 1Hall 0 2Hall 1 Upto this ok, But when add another record for Hall then also it enter it as 3Hall 1 Means every time Cursor c4 = sampleDB.rawQuery(SELECT MAX(RoomSuffix) AS MAX_SUFFIX FROM RoomTable,null);
[android-developers] Re: select (mac) query problem.
Ohh Kostya Thank you very much for your precious time. I will first look tutorial and then try to fix the problem. Once again Thank you. On Nov 29, 4:14 pm, Kostya Vasilyev kmans...@gmail.com wrote: If you want a separate suffix sequence for each room name (if I understand you correctly), change your query for MAX_SUFFIX to filter by room name. SELECT MAX(RoomSuffix) FROM ROOM_TABLE_NAME WHERE RoomName = room name here I recommend you read through a SQL tutorial of some sorts. Here is one: http://www.sqltutorial.org/ -- Kostya 29.11.2010 14:02, pramod.deore пишет: You are right Kpstya after chenging to suf = c4.getInt(c4.getColumnIndex(MAX_SUFFIX))+1; It solve my partial problem . But Now here is new issue arrise which is I also faced when I user SharedPreference. Now the problem is If I have data like 1 Hall 0 2 Hall 1 3 Kitchen 0 4. kitchen 2 5. Hall 3 Here what I want 1 Hall 0 2 Hall 1 3 Kitchen 0 4. kitchen 1 5. Hall 2 On Nov 29, 3:42 pm, Kostya Vasilyevkmans...@gmail.com wrote: Your code never gets the actual value for MAX_SUFFIX. You're calling getColumnIndex, but never - getInt. I see you tried to fix it by doing +1 on the value - that's a pretty good tip-off that you are doing something wrong. -- Kostya 29.11.2010 13:33, pramod.deore пишет: Hi, But there is a problem . getColumnIndex(MAX_SUFFIX) doesn't return the highest integer. Here is in short what I am doing:- I have at table which have 3 columns:1. RoomId, 2. RoomaName 3. RoomSuffix If suppose in database there are following data RoomID RoomName 1 Hall 2 Kitchen and suppose user again add Hall then in that case RoomSuffix must have to increase by 1. RoomID RoomName RoomSuffix 1 Hall 0 2 Kitchen 0 3 Hall 1 4 Hall 2 Here I had created a table as public void insertToRoomTable(String roomName) { try { sampleDB.execSQL(CREATE TABLE IF NOT EXISTS + ROOM_TABLE_NAME + (RoomID integer primary key autoincrement,RoomName VARCHAR,RoomSuffix integer);); boolean roomExist = checkRoomExist(roomName); System.out.println (!...@#!@#...@#!@#+roomExist); System.out.println (Here value of suf +suf); sampleDB.execSQL(INSERT INTO + ROOM_TABLE_NAME + Values (null,'+roomName+','+suf+');); } catch (Exception e) { e.printStackTrace(); } } public boolean checkRoomExist(String name) { Cursor c = sampleDB.rawQuery(SELECT RoomName FROM +ROOM_TABLE_NAME , null); if (c != null ) { System.out.println (%%%+c.getCount()); if (c.moveToFirst()) { do { rname = c.getString(c.getColumnIndex(RoomName)); System.out.println (name is +name); System.out.println (name is +rname); if (name.equalsIgnoreCase(rname)) { System.out.println (Room already exist); //String str = select max(RoomSuffix) from RoomTable; Cursor c4 = sampleDB.rawQuery(SELECT MAX(RoomSuffix) AS MAX_SUFFIX FROM RoomTable,null); if (c4 != null ) { if (c4.moveToFirst()) { do { System.out.println (***); System.out.println (c4.getColumnIndex(MAX_SUFFIX)); suf = c4.getColumnIndex(MAX_SUFFIX)+1; System.out.println (+suf); } while (c4.moveToNext()); return true; } } } }
[android-developers] Re: Licensing Server and free apps
Hi Patrick, Your use case is not really relevant, because if you release an app for free, you cannot later charge money for it. I don't recall whether this is actually in the distribution agreement, but it is the way the market dashboard has been implemented. If you do not release the app through the market, you will also not have access to the licensing server except through test accounts. You could release the app to testers and put their Id into the server as test accounts. That would allow them to run a version that you've given them with whichever response you've set up in your dashboard (but the same response for all). Regards, Michael A. On Nov 29, 10:25 am, Patrick patrick.manges...@gmail.com wrote: Hallo! I have the following usecase: I am developing an application, that will be commercial once it is done. Currently it is unfinished but I want a beta version to be offered to a list of selected users. Those users should be able to download the application using the market for free. Going throught the tutorial of the licensing server I found the following: Licensing is currently for paid apps only, since free apps are considered licensed for all users. If your application is already published as free, you won't be able to upload a new version that uses licensing. Is it possible to implement licensing in the application, upload it to the market for free and offer it to a list of users, whose gmail address I know? Other users should not see the application or at least should not be able to run it. Thanks in advance for your help Patrick -- 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 build a 2d GUI to an OpenGL ES app?
It's not stupid, if you consider creating a multi-platform app you are bound to native code :P. If you just want to make an Android one you should only go native if it's absolutely necessary in a performance manner. On Nov 27, 5:19 pm, Miguel Morales therevolti...@gmail.com wrote: Yes, the standard way of developing 3D is using the STANDARD development kit. Don't start with C, unless you absolutely need to. People tend to go directly to the NDK because they don't like Java, that's just stupid. Start off with the Java classes, if you really need to, use the NDK. On Sat, Nov 27, 2010 at 1:32 AM, Eyvind Almqvist eyv...@mobile-visuals.com wrote: I understand that GLSurfaceView and SurfaceView are Java classes, but I thought that you should use Open GL C++ for the 3d graphics. I then searched for more information about this and I found the android.opengl package. So do you mean that I should use the android.opengl package to develop the 3d graphics in openGL? Is this the standard way to develop 3d graphics in Android? On 25 Nov, 12:27, Miguel Morales therevolti...@gmail.com wrote: What? No, no C++. Just use a GLSurfaceView to render all your 3dopenGLstuff. Then add an overlay View (maybe a SurfaceView) and add all your regular2Dcontrols/widgets that come with Android. On Thu, Nov 25, 2010 at 3:11 AM, Eyvind Almqvist eyv...@mobile-visuals.com wrote: Do you mean mixing Java and C++ in an Android project? SurfaceView and theGUIin Java and GLSurfaceView and the visual effects in OpenGLC+ +? On 25 Nov, 01:12, Miguel Morales therevolti...@gmail.com wrote: You can simply have a SurfaceView overlaying your GLSurfaceView and draw whatever HUD orGUIelements you want using the regular Android widgets. On Wed, Nov 24, 2010 at 5:43 AM, Eyvind Almqvist eyv...@mobile-visuals.com wrote: I want to make anOpenGLESversion of my M3GappAstral 3d worlds. Theapphas a2dGUI, from which you can start 10 visual effects. I can port the visual effects toOpenGLES, but how can Ibuildthe 2dGUI? Should I really useOpenGLESfor that? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- ~ Jeremiah:9:23-24 Android2DMMORPG:http://developingthedream.blogspot.com/,http://www.youtube.com/user/r... -- 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 -- ~ Jeremiah:9:23-24 Android2DMMORPG:http://developingthedream.blogspot.com/,http://www.youtube.com/user/r...Dölj citerad text - - Visa citerad 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 -- ~ Jeremiah:9:23-24 Android 2D MMORPG:http://developingthedream.blogspot.com/,http://www.youtube.com/user/revoltingx -- 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: Static Layout for whole app that must be in all Activity
Thank you for allGiving me great suggestions . On Nov 24, 3:32 am, TreKing treking...@gmail.com wrote: On Tue, Nov 23, 2010 at 4:12 PM, bruce palant...@gmail.com wrote: Probably the best way to achieve this is to create a base activity class and extend it for all your other activities. That works if you're only extending Activity in each of your own Activities. If you're using Lists, Tabs, or especially Maps, you're SOL. I would recommend a custom View that encapsulates and manages the logic for this Static Layout, which you then simply add to each of your Activities' layouts with a include tag. --- -- 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 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] Detect touch event on a OpenGL object
Hi there! I have developed an Augmented Reality App using OpenGL ES 1.1. It's really cool and I'm very happy for that, because Im' an opengl beginner. Now I have a problem... :( I'd like to detect touch events on some opengl objects. I know I can't use View.EventListener with those, because these objects don't inherit from View class. They are simply subclasses of Object that implement an opengl draw function. I've read about picking in OpenGL, but before to take this way, I want to understand if there are other solutions. So, which can the solution be to do that? Thanks in advance. Paolo -- 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 set the Foreground for the frames ?
Hi, Have you tried FrameLayout.setForeground(Drawable drawable); FrameLayout.setForeground(Drawable drawable) to set Any foregroud drawable for FrameLayout. if you pass drawable as null then it means that noforeground has been set. Please correct me if i am wrong. On Nov 29, 2:26 pm, jani basha shaik jani@gmail.com wrote: hai, i am new buddy for android platform . I want to setForeground image for the callee layout in call screen of android. To do this in layout xml file i have changed that callee frames as FrameLayout and then by getting ids of Framelayout i am setting foreground for each callee lines. it's working fine for only 2 calls (at max i can make 3 calls at the same time by putting other two active calls in hold) , when ever i make a third call lot of contravention happening. so, my question is without changing layout xml files by using any animation or opacity we can change the frames foreground ? Is it possible , plz give me example if possible. (note : if i press the menu options then also the opacity must shown for frames ) if it is possible plz , suggest me the way how can i make this possible ? thanks in advance... -- 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] Orientation change for widget
Hi, Is there any way to change orientation for only some part my screen (Framelayout) within my activity whenever there is a configuration change. Here is My activity defination in Manifest File activity android:name=.TestActivity android:label=@string/app_name android:screenOrientation=portrait android:configChanges=orientation|keyboardHidden Here is my XML layout for TestActivity ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=horizontal android:layout_width=fill_parent android:layout_height=fill_parent TextView android:layout_width=wrap_content android:layout_height=fill_parent android:text=@string/hello / com.xyz.test.TestUi android:id=@+id/testUi android:layout_width=fill_parent android:layout_height=wrap_content / /LinearLayout Here i want to apply orientation only for my com.xyz.test.TestUi. Regards, Anzi -- 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: Detect touch event on a OpenGL object
I have the same issue, any suggestion? On 29 Nov, 13:24, Paolo brand...@gmail.com wrote: Hi there! I have developed an Augmented Reality App using OpenGL ES 1.1. It's really cool and I'm very happy for that, because Im' an opengl beginner. Now I have a problem... :( I'd like to detect touch events on some opengl objects. I know I can't use View.EventListener with those, because these objects don't inherit from View class. They are simply subclasses of Object that implement an opengl draw function. I've read about picking in OpenGL, but before to take this way, I want to understand if there are other solutions. So, which can the solution be to do that? Thanks in advance. Paolo -- 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 calculate sound sample duration using SoundPool / AudioManager construct
Hi, Have had this problem for a while now. I am using SoundPool / AudioManager combination to load 30 audio samples (for a sound sampling app) and it's working great ! But, now I need to add the information about every sample's duration in the GUI. Have looked through the docs and couldn't find the answer :( I am using .ogg format. Any hints ? Thanks, Hatch -- 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: Detect touch event on a OpenGL object
My GL skillz are a little rusty, but there are a few ways I still remember. 1 - This is a trick. Draw your objects one by one with a solid color, call glReadPixels after each to read a few pixels around the touch point. Use the color information you get from glReadPixels to check if the last object you rendered covered the touch point. Do not flip the buffers at the end (so your scene doesn't show with wrong colors). Pros: easy to do Cons: glReadPixels can be slow. 2 - Test in screen coordinates. Go through objects one by one, project their bounding sphere into screen coordinates, use math to see if the touch point is within the projected area. Pros: still easy to do Cons: projects each object into screen coordinates. 3 - Test in world coordinates Two points define a line. One is the camera position, the other is the touch point converted into world coordinates. This gives you a ray that shoots forward into the scene. Go through objects one by one, check if the ray intersects the object's bounding box. Pros: faster Cons: somewhat harder to do There are utility functions for converting coordinates between screen space and world space: glProject and glUnProject. They are part of the GL Utility library that's not included in Android. However, you can easily find sample implementations of these. Here is one place: http://www.opengl.org/wiki/GluProject_and_gluUnProject_code Here is another: http://oss.sgi.com/cgi-bin/cvsweb.cgi/projects/ogl-sample/main/gfx/lib/glu/libutil/ (look in project.c) -- Kostya 29.11.2010 16:19, pedr0 пишет: I have the same issue, any suggestion? On 29 Nov, 13:24, Paolobrand...@gmail.com wrote: Hi there! I have developed an Augmented Reality App using OpenGL ES 1.1. It's really cool and I'm very happy for that, because Im' an opengl beginner. Now I have a problem... :( I'd like to detect touch events on some opengl objects. I know I can't use View.EventListener with those, because these objects don't inherit from View class. They are simply subclasses of Object that implement an opengl draw function. I've read about picking in OpenGL, but before to take this way, I want to understand if there are other solutions. So, which can the solution be to do that? Thanks in advance. Paolo -- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.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] Re: can we upgrade phone from 2.1 to 2.2
thanks very much On Nov 29, 3:25 pm, Kostya Vasilyev kmans...@gmail.com wrote: There is no SDK on the phone. SDK is what you use to develop applications - on a desktop computer. Phones (and other devices) have firmware, which is the Android platform, of a particular version, that is made to work on that particular phone model, sometimes with new functionality (HTC Sense, MOTOBLUR, Samsung TouchWiz, etc.) Some manufacturers release firmware updates for their Android phones, some even do it more or less on time. Some don't. Some examples: - HTC was late with their 1.6 to 2.1 update for the Hero by about six months. - Samsung released 2.1 to 2.2 update for the Galaxy S only about two months late. - Motorola is already some 3 months late with a 2.2 update for the Milestone, still unreleased. Since you mentioned the Samsung Galaxy in your original message, I already provided information specifically about that phone. -- Kostya 29.11.2010 13:03, Atik пишет: means u mean to say k user can update there SDK . i was thinking that once any one purchases a cell phone with a particular SDK , that will remain unchaged and we cant update the same. means i was thinking that if a person bought a android 2.1 eclairs device then he will be using the same device without any updates for lifetime with the same sdk. please clarify . i know i am wrong, but need some more info about it. Thanks Atik On Nov 29, 1:25 pm, Kostya Vasilyevkmans...@gmail.com wrote: If by Galaxy 3 you mean Galaxy S - Samsung started rolling out updates to 2.2 recently. The exact dates are country-specific - I received mine in Russia on November 24 - but it's ongoing. -- Kostya 29.11.2010 9:41, Atik пишет: hello all, i am planning to buy galaxy 3, which is having 2.1 eclairs sdk. so after few days can we update the mobile sdk versions to the new versions??? or we have to use 2.1 only for lifetime. pls suggest me android phone. -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.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] ShapeDrawable border or inside another shapeDrawable
Hi, i need to use an oval ShapeDrawable as my Button's background. it is done by using: ?xml version=1.0 encoding=utf-8? shape xmlns:android=http://schemas.android.com/apk/res/android; android:shape=oval solid android:color=#CC stroke android:width=2dp android:color=#FF00 /stroke /solid /shape as my Button's background, but i need a border for the shape, to make it looks like a circle inside another circle (one with a color and the other with another color). some idea?? thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Binary sms?
All data is 0s and 1s. You can send an sms to the emulator using the simulator features in eclipse. Are you looking specifically to only send binary without a pre-established text? On Nov 26, 8:47 pm, vnv nikola1...@gmail.com wrote: Hi, is there a way to generate binary sms in emulator? -- 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: SQLite Performance
The database is strictly read-only on the Android side. When created on the PC, I issue, for example, the command CREATE INDEX EvtIdx ON tblEvtRef (idind);. On the Android side, I use the SQLiteDatabase.query method, in which one specifies the SQL command in fragments as opposed to having it parse out an entire query string, but what I'm doing is equivalent to: SELECT col1,col2,... FROM tblEvtRef WHERE idind = val; Where val is an integer e.g, idind = 221 (this is not the primary key, and multiple matches are expected). All of my queries are basically at this level of simplicity. I'll take a look at the database on the Android using the sqlite3 utility and see what it tells me, but overall SQLite is a somewhat restricted subset of what a typical database server would provide. Still, I'd like to exhaust any possible avenues for improving efficiency. Doug Gordon On Nov 28, 3:14 pm, Frank Weiss fewe...@gmail.com wrote: I assume you appreciate the fact that just knowing SQL is not knowing how to optimize queries. I'm also going to assume that the read queries are the issue. Insert and delete queries are a whole different issue with respect to indexing. Indexes are indeed the primary means of optimizing SQL queries. I'm wondering if the create index command you ran on the PC is actually in effect on the Android device. If I'm not mistaken, you should be able to verify that the DB on the device actually has indexing enabled. Have you verified the speedup that indexing provided on the PC? If adding column indexing by itself is not effective, you'll need to look into the queries and the actual data patterns. Some queries are structured so that the DB cannot use indexes. See if sqlite has an analyze command for debugging queries. It will show the steps it would use to execute the query. If there's no step that uses the index (even if there is a column index) or if the index lookup is at the end of the steps, then the query is not making maximal use of the index. It's a bit of an art to coerce the query compiler to do it right and sometimes there are pitfalls in SQL that need to be understood. How many queries does you app use? Which one is the bottleneck? Can you post the query? -- 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] Setting alarm time
Hi, I need to set an alarm clock for, say, 9AM so I am getting a calendar instance Calendar cal = new GregorianCalendar(TimeZone.getTimeZone(UTC)); cal.set(2010, 11, 29, 9, 0, 0); and then I call AlarmManager.set like: mAlarmManager.set(AlarmManager.RTC_WAKEUP, cal.getTime().getTime(), pi); where pi is a pending intent for a broadcast message. I do not receive a callback at the specified time. How do I correct this? Cheers, Earlence -- 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: Detect touch event on a OpenGL object
I've read about picking in OpenGL Beware that selection mode is not available in OpenGL ES. I want to understand if there are other solutions. You have various options, but none is simple: 1. unproject from the (x,y) screen coordinates to a ray in model space, and work out which object(s) intersect that ray. 2. unproject from the (x,y) screen coordinates and the corresponding z coordinate from the depth buffer to a point in model space, and work out which object includes that point. 3. Draw your entire scene a second time into an off-screen framebuffer (possibly at lower resolution), but instead of using the objects' actual textures or colours, use a unique colour for each object. Then just look at the colour in this framebuffer at the selected (x,y) point, and you can decode the corresponding object. These are all general techniques. Sometimes your application will have characteristics that let you do something simpler, e.g. a constrained projection or object layout. Good luck! Phil. -- 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] Why froyo copies package with index -1.apk to /data/app
since 2.2 i have the problem that i see froyo copies com.android.myapp.apk as com.android.myapp-1.apk to /data/app after installation. So during first start , my app searches com.android.myapp.apk to unpack libraries, but this file of course doesn't exist. I would like to know why ? And how can i make the change in my app. thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Detect touch event on a OpenGL object
Yes I have just seen that selected mode is not available in OpenGL ES. So, I'm trying to follow the other ways, starting from color- solution, that seems the simplest. But I already get a problem... :( At every frame I'd draw many markers (every marker has different coordinates) in the scene and I do it in one draw function, something like this: public void onDrawFrame(GL10 gl) { float colorCount = 0.0f; gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glMatrixMode(GL10.GL_MODELVIEW); gl.glLoadIdentity(); gl.glLoadMatrixf(matrix.val, 0); for(int i = 0; imarkers.size(); i++){ gl.glColor4f(colorCount, 0, 0, 1); markers.get(i).draw(); colorCount++; } } but unfortunately it doesn't work. The color remains always white (0,0,0,1) in RGBA. I'm confused. I know it may be a stupid question, but I'm a beginner in OpenGL. On 29 Nov, 16:59, Phil Endecott spam_from_goo...@chezphil.org wrote: I've read about picking in OpenGL Beware that selection mode is not available in OpenGL ES. I want to understand if there are other solutions. You have various options, but none is simple: 1. unproject from the (x,y) screen coordinates to a ray in model space, and work out which object(s) intersect that ray. 2. unproject from the (x,y) screen coordinates and the corresponding z coordinate from the depth buffer to a point in model space, and work out which object includes that point. 3. Draw your entire scene a second time into an off-screen framebuffer (possibly at lower resolution), but instead of using the objects' actual textures or colours, use a unique colour for each object. Then just look at the colour in this framebuffer at the selected (x,y) point, and you can decode the corresponding object. These are all general techniques. Sometimes your application will have characteristics that let you do something simpler, e.g. a constrained projection or object layout. Good luck! Phil. -- 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] Setting alarm time
This looks suspect: TimeZone.getTimeZone(UTC) Unless you are actually in that time zone -- Kostya 29.11.2010 19:00, Tez пишет: Hi, I need to set an alarm clock for, say, 9AM so I am getting a calendar instance Calendar cal = new GregorianCalendar(TimeZone.getTimeZone(UTC)); cal.set(2010, 11, 29, 9, 0, 0); and then I call AlarmManager.set like: mAlarmManager.set(AlarmManager.RTC_WAKEUP, cal.getTime().getTime(), pi); where pi is a pending intent for a broadcast message. I do not receive a callback at the specified time. How do I correct this? Cheers, Earlence -- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.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
Re: [android-developers] Setting alarm time
This looks suspect: TimeZone.getTimeZone(UTC) Unless you are actually in that time zone -- Kostya 29.11.2010 19:00, Tez пишет: Hi, I need to set an alarm clock for, say, 9AM so I am getting a calendar instance Calendar cal = new GregorianCalendar(TimeZone.getTimeZone(UTC)); cal.set(2010, 11, 29, 9, 0, 0); and then I call AlarmManager.set like: mAlarmManager.set(AlarmManager.RTC_WAKEUP, cal.getTime().getTime(), pi); where pi is a pending intent for a broadcast message. I do not receive a callback at the specified time. How do I correct this? Cheers, Earlence -- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.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
Re: [android-developers] Can we Import contacts in List Preferences
On Mon, Nov 29, 2010 at 4:53 AM, nubh bhargava nubh.bharg...@gmail.comwrote: I am trying to import contacts in the preferences, What are the preferences? actually I want that particular code should access a contact which I select and that value needs to be passed to other class or activity in future. Can you clarify this? For that I need to import contacts in the form of array I suppose. I need to know how I can pass the values in the list form to the preferences. What are the values? What is the list form? - 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 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: Orientation change for widget
Android has two types of Views. i. View - Widget ii. ViewGroup - Containers View can specify its dimension but finalized by ViewGroup. ViewGroup specifies layout(including orientation) of its childs and finalizes its childs dimension. ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=horizontal android:layout_width=fill_parent android:layout_height=fill_parent TextView android:layout_width=wrap_content android:layout_height=fill_parent android:text=@string/hello / com.xyz.test.TestUi android:id=@+id/testUi android:layout_width=fill_parent android:layout_height=wrap_content / /LinearLayout The above com.xyz.test.TestUi orientation is decided by immediate parent LinearLayout. So the orientation of com.xyz.test.TestUi is not decided by it self. Here i want to apply orientation only for my com.xyz.test.TestUi. You have to design your orientation(have different layouts) for different configurations. -- 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 we Import contacts in List Preferences
Here is a very good overview of a Contact API: http://www.higherpass.com/Android/Tutorials/Working-With-Android-Contacts/ As for preferences, if I understand correctly what it is you want to do, then you could use modifyIntent passing in a unique string and value to save off. On Nov 29, 4:53 am, nubh bhargava nubh.bharg...@gmail.com wrote: Hi, I am trying to import contacts in the preferences, actually I want that particular code should access a contact which I select and that value needs to be passed to other class or activity in future. For that I need to import contacts in the form of array I suppose. I need to know how I can pass the values in the list form to the preferences. Please help. Thanks in advance for the help I always get at this forum Nishant Bhargava -- 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] App freezes when the power key is pressed
My app freezes when the power key is pressed. This happens on SonyEricsson X10 and X8, but not on Samsung Galaxy S. This is what happens: 1)Launch the application-Press power key- Press power key again to active app-App freeze. The app also freezes when the USB cable is inserted, like this: 2)Launch the application- Insert USB cable-Message pops up and click any option to continue- App freeze. I am distributing apps to SonyEricsson's Playnow appstore. They have reported this as error, so I have to fix this. Does anyone have an idea how to fix this? I have already followed all the advices in Designing for Responsiveness on http://developer.android.com/guide/practices/design/responsiveness.html -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Why froyo copies package with index -1.apk to /data/app
Because it simplified the implementation. You should *never* be relying on absolute paths. There is an API to get the path to your .apk -- Context.getApplicationInfo(). On Mon, Nov 29, 2010 at 8:23 AM, Mr Pinguin pinguint...@googlemail.comwrote: since 2.2 i have the problem that i see froyo copies com.android.myapp.apk as com.android.myapp-1.apk to /data/app after installation. So during first start , my app searches com.android.myapp.apk to unpack libraries, but this file of course doesn't exist. I would like to know why ? And how can i make the change in my app. thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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: App freezes when the power key is pressed
What do you mean by freeze ? A Force close or a This app does not respond, wait or kill message, or no message at all ? From what you describe I'd guess you have a memory leak or an exception raising during the onStart or onResume of your app. You can probably replicate the problem on any device by just doing a few screen orientation changes which will mimick what you describe(the lost of focus by your activity) Don't stay in the dark when you can't access a device that crashes, use something like the android-remote-stacktrace to receive emails from your app with the full stack. http://code.google.com/p/android-remote-stacktrace/ Good luck. Yahel On Nov 29, 7:05 pm, Eyvind Almqvist eyv...@mobile-visuals.com wrote: My app freezes when the power key is pressed. This happens on SonyEricsson X10 and X8, but not on Samsung Galaxy S. This is what happens: 1)Launch the application-Press power key- Press power key again to active app-App freeze. The app also freezes when the USB cable is inserted, like this: 2)Launch the application- Insert USB cable-Message pops up and click any option to continue- App freeze. I am distributing apps to SonyEricsson's Playnow appstore. They have reported this as error, so I have to fix this. Does anyone have an idea how to fix this? I have already followed all the advices in Designing for Responsiveness on http://developer.android.com/guide/practices/design/responsiveness.html -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] App freezes when the power key is pressed
What do you mean your app freezes? This is not a typical failure case when pressing the power button. :} On Mon, Nov 29, 2010 at 10:05 AM, Eyvind Almqvist eyv...@mobile-visuals.com wrote: My app freezes when the power key is pressed. This happens on SonyEricsson X10 and X8, but not on Samsung Galaxy S. This is what happens: 1)Launch the application-Press power key- Press power key again to active app-App freeze. The app also freezes when the USB cable is inserted, like this: 2)Launch the application- Insert USB cable-Message pops up and click any option to continue- App freeze. I am distributing apps to SonyEricsson's Playnow appstore. They have reported this as error, so I have to fix this. Does anyone have an idea how to fix this? I have already followed all the advices in Designing for Responsiveness on http://developer.android.com/guide/practices/design/responsiveness.html -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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: Setting alarm time
I have tried using GMT as well. no use. Something is wrong in my understanding of how this works. Can anyone help? On Nov 29, 5:21 pm, Kostya Vasilyev kmans...@gmail.com wrote: This looks suspect: TimeZone.getTimeZone(UTC) Unless you are actually in that time zone -- Kostya 29.11.2010 19:00, Tez пишет: Hi, I need to set an alarm clock for, say, 9AM so I am getting a calendar instance Calendar cal = new GregorianCalendar(TimeZone.getTimeZone(UTC)); cal.set(2010, 11, 29, 9, 0, 0); and then I call AlarmManager.set like: mAlarmManager.set(AlarmManager.RTC_WAKEUP, cal.getTime().getTime(), pi); where pi is a pending intent for a broadcast message. I do not receive a callback at the specified time. How do I correct this? Cheers, Earlence -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.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
Re: [android-developers] Re: Setting alarm time
On Mon, Nov 29, 2010 at 12:20 PM, Tez earlencefe...@gmail.com wrote: I have tried using GMT as well. no use. What's *your* time zone? - 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 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: Drawing a circle on a MapView to mark the accuracy of the location estimation ?
drawCircle requires diameter in pixels. In order to convert accuracy (in meters from LocationProvider) into pixels you can do this: - convert current location (GeoPoint) into pixels using mapView.getProjection.toPixels() - create another GeoPoint with longitude = center.getlatitudeE6() + accuracy * 11 - also convert this position into pixels - get delta between Y coordinates those two points. This is the radius of your circle. On Nov 28, 4:05 pm, TreKing treking...@gmail.com wrote: On Sun, Nov 28, 2010 at 4:42 PM, Emre A. Yavuz eayl...@hotmail.com wrote: Does anybody have a piece of code or a link that can guide me to draw a circle on a MapView to mark the accuracy of the location estimation ? Is using GPolygon() the only way ? No, you can just use this: Canvas.drawCircle()http://developer.android.com/reference/android/graphics/Canvas.html#d... . --- -- 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 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] problem with camera
hi I'm new to android and I'm developing a camera app, my code (which so far just starts preview!) works fine on emulator, but on real device (nexus one) i have got unexpectedly stopped. i will be thankful if somebody help me, here is my code: package com.camera; import java.io.IOException; import android.app.Activity; import android.os.Bundle; import android.graphics.PixelFormat; import android.hardware.Camera; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.Window; public class camera extends Activity implements SurfaceHolder.Callback{ public Camera mCamera; boolean mPreviewRunning=false; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFormat(PixelFormat.TRANSLUCENT); setContentView(R.layout.main); SurfaceView mSurfaceView = (SurfaceView)findViewById(R.id.preview); SurfaceHolder mSurfaceHolder = mSurfaceView.getHolder(); mSurfaceHolder.addCallback(this); mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } @Override public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { if (mPreviewRunning) { mCamera.stopPreview(); } Camera.Parameters p = mCamera.getParameters(); p.setPreviewSize(w, h); mCamera.setParameters(p); try { mCamera.setPreviewDisplay(holder); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } mCamera.startPreview(); mPreviewRunning = true; } @Override public void surfaceCreated(SurfaceHolder mSurfaceHolder) { // TODO Auto-generated method stub mCamera=Camera.open(); } @Override public void surfaceDestroyed(SurfaceHolder arg0) { // TODO Auto-generated method stub if (mPreviewRunning) { mCamera.stopPreview(); } mPreviewRunning=false; mCamera.release(); } } -- 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] IME composing text's typeface
Hi, might it possible to change the typeface of the composing text for an input method with my own font ? I built a typeface and changed the typeface of view sucessfully with my own font (Paint.setTypeface). I could also changed the composing text's typeface by using typefacespan using the system embeded font (compsing.setSpan(monospace, 0, composing.length(), Spanned.SPAN_COMPOSING);). However, I could not find a way to change the composing text with typeface, creating typefacespan with own font, or convert the typeface to typefacespan. Are there any solution for it? It would be great if there have a way to change all the typeface, such as view and composing text, at the same time. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] What's the best way to have your app 'sleep' for N milliseconds?
I want to display a message on the screen, have it displayed for 60 seconds, then display another message. There is nothing specific going on during the 60 seconds that I'm waiting to complete, so AsyncTask doesn't seem to apply. Does someone have a generic code snippet that does this so that I can use it in other places as needed? -- 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 count the number of launches of my app?
Hi all, What I want to do is to log whenever user launches my app. So, I instrumented a logging code(which make a request to the server) into onCreate() of the base activity, and the server counts the requests. However, the problem is that the code wasn't called if user press home key rather than back key. More specifically, launch the app - onCreate() is called - press home key - relaunch the app = onCreate() is NOT called. Is there anyone who know where I need to add my logging code? Thanks! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Using street view in my application
I want to use StreetView inside my application, not launching it as external application with google.streetview:cbll=lat,lngcbp=1,yaw,,pitch,zoommz=mapZoom @http://developer.android.com/guide/appendix/g-app-intents.html Is there any way to do this? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] android bluetooth
I am using an handsfree bluetooth handset in ndroid device. i need to program the handsfree in my application. Firstly, when i create a beep sound it should be heard in handsfree. When i press some button (in fact 1 out of 2 buttons, I need yes or no answer) in handsfree and the appropriate answer is received by my application is this possible ? how to do this ? regards -- 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] TrackBall
Hello all, I can use the trackball to scroll through a list, but i didn't find a way for clicking on items... Is there a way to press it down? Thx. -- 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 make the flash application on android non exitable
Hi, I am trying to make the survey application on Android Tablet PC and my requirement is to make the application in Flash that is non exitable i.e. the user would not be able to: 1. Exit the application 2. Switch between different application 3. Minimize the application... Does all these things possible in android... I want your suggestions how can I make that kinda application OR Flash is not proper and I need to program it in android SDK Please suggest... Thanks Ash -- 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: Handler.postDelayed not working when screen goes off
Thank you all for the discussion which saves my investigation. I was using the Handler.postDelayed() with something like a AlarmRunner to make a count down. Then I get the same problem that, handler paused when my phone standby. I'll switch to AlarmManager instead according to your suggestions. Btw, seems it's really important for Android developers to get a real phone for testing. Emulator is just emulator... On Nov 29, 1:31 am, Kostya Vasilyev kmans...@gmail.com wrote: Paul, You don't need a Service or a Handler to handle events from Alarm Manager - just a Broadcast Receiver. It's even better, in that Android guarantees to hold a wake lock for the duration of your receiver's onReceive. -- Kostya 28.11.2010 18:59, Paul Townsend ?: Hi guys thx for your help, been playing around with it and I tried setting up a service which works, but this will run in the background all the time so if I use an alarm manager how accurate is it can you set one for say 30 seconds time, or is it still bad to use a service even though all its doing is waiting for handler.post() to come along to play a sound. The timer is designed to have several times per timer so each timer will finish several times, i.e pyramid splits, and can have many timers On 21 November 2010 23:30, Dianne Hackborn hack...@android.com mailto:hack...@android.com wrote: You don't need to try around with different things, the behavior is very well defined: if you are not holding a wake lock, the CPU is allowed to go to full sleep, so no code can be executed until an external event wakes it up. A thread sitting there waiting on a timer is never an external event. If you need to make sure you wake up even if the CPU is asleep, use the AlarmManager. On Sun, Nov 21, 2010 at 8:21 AM, Paul Townsend deer...@gmail.com mailto:deer...@gmail.com wrote: Just tried that bvut dose the same thing, although I have used countdownTimer in a custom TextView that I wrote so I could have a countdown timer for the UI and this dose not pause. I might look into to transfering the other timer bits to the text view and use that as a all in one timer solution and see if that works. On 21 November 2010 03:34, Hal dsheppar...@gmail.com mailto:dsheppar...@gmail.com wrote: You may want to look at CountDownTime also. It seems to work fine (even when the Screen goes off). I took the following from the web: public class MyCount extends CountDownTimer { public MyCount(long millisInFuture, long countDownInterval) { super(millisInFuture, countDownInterval); } public void onFinish() { counter = new MyCount(5000, 1000); counter.start (); } public void onTick(long millisUntilFinished) { tv.setText(Hal: + timer.getTime()); } } The timer component uses a Live Jt component (separate thread): private void timer() { JtFactory main = new JtFactory (); // Create the component timer = (Timer) main.createObject (Timer.JtCLASS_NAME); // Asynchronous processing of messages. main.setSynchronous(false); main.sendMessage (timer, new JtMessage (Timer.UPDATE_TIME)); } . counter = new MyCount(5000, 1000); counter.start(); setContentView(tv); ... On Nov 20, 3:58 pm, Paul Townsend deer...@gmail.com mailto:deer...@gmail.com wrote: I made a simple countdown timer and it works as expected when plugged in via usb for debugging but when I take it off debugging and the screen goes off either time out or power button the handler fails to fire at the end time. I have created a custom timer class that gets created from the main activity when needed, because its able to have multiple countdowns running at the same time. Am I right in thinking that the handler just gets paused when the screen goes off and if so what are my alternatives. The activity is still in the foreground and I assumed the handler would still fire if the screen goes off. -- You received this message because you are
[android-developers] Can you detect a touch to the screen when the screen is off? (Wake up screen with a touch)
I was wondering if it was possible to detect a touch of the screen when the screen is off. I know this doesn't make sense for most apps (if its in your pocket you dont want it to register touches when off) but for the app im developing i need/want it to. The phone is going to be left on the table when this app is used, usually in the dark, and so want to turn the screen off whilst its not being used (so the light doesn't distract you), but i don't want the normal screen lock to come on, i want to be able to just touch the screen and it comes back to life. One option would be to just make the screen back, but still on, i don't really want this option because power is still used, and black isnt properly black it has a glow to it. I would like to have a screen that is off, but touchable, anyone out there got any ideas? Many thanks Damo -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] What is the best way to send data from Android Application to a Remote MySQL Database?
What is the best way to send data from Android Application to a Remote MySQL Database? -- 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 Show a pdf file in Android Emulator?
Hi All, Can anyone please suggest me how to show a pdf file or Text file in Android Emulator while developing an application? I have one more question. When I created a sample for Video Player (Which needs to play Video files), In Android Emulator 2.1 and 2.2 I am not able to view the video but can able to hear Audio.But when I Opened the same with Android Emulator with version 1.5 I am able to view Video. Can anyone specify why it is happening? Can I able to view these videos in Real Android Device?? Thanks in Advance. Chandu. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] android bluetooth
I am using an handsfree bluetooth handset in ndroid device. i need to program the handsfree in my application. Firstly, when i create a beep sound it should be heard in handsfree. When i press some button (in fact 1 out of 2 buttons, I need yes or no answer) in handsfree and the appropriate answer is received by my application is this possible ? how to do this ? regards -- 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] can we upgrade phone from 2.1 to 2.2
i m xtremely sorry as i dont have knowledge so i csn not sgt u abt the ph. -- 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] Implement a rich text editor
Hi there, I am wondering if there are any good options to implement a rich text editor in Android. Please note I am talking about a rich text editor that can be used in an Android application, not the one embedded in a web page using HTML and Javascript. My requirements are: * Basic formatting (color, fonts, highlight, bold, italic, underline, etc.) * Hyperlinks * Inline images * Bullet lists and numbered lists * Inline table (only the contents inside a cell is editable, not the table structure) As you can see, this is pretty much something quite similar to a typical RichEdit control on Windows. Here are some efforts (investigation prototyping) I have made so far: [ Using WebView ] I have tried using a WebView control to load an HTML fragment with one . The content becomes editable and as it is HTML, I suppose it can meet most of my requirements. But it has several issues: * (deadly) No text caret. The user will have no idea where his/her typed characters will be inserted. * The on-screen soft keyboard is not visible by default. There is a trick that the user has to long-press the Menu button to bring up the keyboard. But I think this is a very bad user experience. Besides, the screen layout is not properly rearranged and the text inserting point sometimes will be covered by the keyboard. [ Using EditText ] I have tried using the EditText control. It seems to support some level of rich text editing (color, fonts, bold, italic, underline, inline images, bullet lists). But I still cannot figure out how I can implement the following requirements: * Control the appereance of the bullet symbol (dot, circle, dash, arrow, star, etc.) * Numbered list (1., 2., 3., etc.) * Table BTW, I have seen there are several *Span classes out there but I am not sure if they can be any help... And the http://developer.android.com does not provide much useful information about them. So, how on earth can I implement a rich text editor on Android? Can I extends the EditText and add my new functionalities? Or should I do something from scratch - extends the View and implement everything by myself? For later option (extending View), I actually even don't know how to show a text caret and blink it, not mentionging moving the caret with user typing. I believe there must be some ways of doing this because I did see apps with rich text editting including all features I need (especially tables and numbered lists). I am desperate now... Any hints? Thanks! -Tony -- 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] Passing objects to new intents
I've googled this quite a bit and have seen many arguments to not pass the object rather store it in a database, use a custom Application object, or a static variable. Ultimately, the app will use a database so I'll just pass the id of the record and pull it out in the new intent [correct me if that's not a solid direction] but for now I am strictly looking to learn. Should I continue to explore passing a full POJO to an intent, passing each individual value as an extra [prefer not], or stick with the database approach? Thanks folks! --- John C. Bland II Blog: http://www.johncblandii.com Company: http://www.katapultmedia.com Twitter: @johncblandii -- 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] handing event of two button in widget
Can you send your detailed error log for analysis? Cause it's difficult to track the issue. Br Andy 2010/11/29 Honest honestsucc...@gmail.com hello, i have developed simple widget which display images from sd card. I have two button(for setting and open) on center frame. Now i am calling Activity Class to display User Interface for setting and display Image in big view. But i am getting RunTimeException if i try to use PendingIntent for both button. if i set pendingIntent for one Button then it is working fine. The following is my code snippet. hope to hear soon from you. Intent configIntent = new Intent(context, ImagesWidgetConfiguration.class); configIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId); //To specify open image action configIntent.putExtra(action, open); // gotta make this unique for this appwidgetid configIntent.setData(Uri.withAppendedPath(Uri.parse(URI_SCHEME + :// widget/id/), String.valueOf(appWidgetId))); PendingIntent pendingIntent1 = PendingIntent.getActivity(context, 0, configIntent, PendingIntent.FLAG_UPDATE_CURRENT); remoteView.setOnClickPendingIntent(R.id.play_pause, pendingIntent1); // For SecondButton //remoteView = new RemoteViews(context.getPackageName(), R.layout.main); Intent updateIntent=new Intent(context,ImagesWidgetConfiguration.class); updateIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId); updateIntent.putExtra(action, setting); updateIntent.setData(Uri.withAppendedPath(Uri.parse(URI_SCHEME + :// widget/id/), String.valueOf(appWidgetId))); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, updateIntent, PendingIntent.FLAG_UPDATE_CURRENT); remoteView.setOnClickPendingIntent(R.id.next, pendingIntent); -- 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
[android-developers] Copy a database from a retail phone to a development phone?
I have a need to examine the contacts and call log databases. My development phone has no contacts; it also has no SIM card, and hence no calls. I need realistic data, so I can't just add some random garbage. The obvious answer is to copy the database from my personal (2.1u1 retail build) phone to my development (2.2 debug build) phone. How? I can `adb pull` the databases from my development phone but (while I can `adb shell` to my retail phone, once I turn on USB debugging) I can't `adb pull` the databases from my retail phone. Is there a better way than writing an export utility that will dump the retail databases to text files, and an import utility that will append that data to the debug databases? -- 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] cursor.requery() in non-UI thread: CalledFromWrongThreadException
Hello team, I have ListView with the attached CursorAdapter. For known reasons I want to call cursor.requery() on non-UI thread (using AsyncTask) but it fails with the CalledFromWrongThreadException. As I understand the adapter tries to update UI from the thread where requery() method was called. Is it possible somehow to make adapter update UI from UI-thread on calling requery in non-UI thread. The exception: Caused by: android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. at android.view.ViewRoot.checkThread(ViewRoot.java:2692) at android.view.ViewRoot.clearChildFocus(ViewRoot.java:1518) at android.view.ViewGroup.clearChildFocus(ViewGroup.java:507) at android.view.ViewGroup.clearChildFocus(ViewGroup.java:507) at android.view.ViewGroup.clearChildFocus(ViewGroup.java:507) at android.view.ViewGroup.clearChildFocus(ViewGroup.java:507) at android.view.ViewGroup.clearChildFocus(ViewGroup.java:507) at android.view.ViewGroup.clearChildFocus(ViewGroup.java:507) at android.view.ViewGroup.clearChildFocus(ViewGroup.java:507) at android.view.ViewGroup.clearChildFocus(ViewGroup.java:507) at android.view.ViewGroup.clearChildFocus(ViewGroup.java:507) at android.view.View.clearFocus(View.java:2569) at android.view.ViewGroup.clearFocus(ViewGroup.java:516) at android.view.View.setFlags(View.java:4343) at android.view.View.setFocusable(View.java:3093) at android.widget.AdapterView.checkFocus(AdapterView.java:695) at android.widget.AdapterView $AdapterDataSetObserver.onInvalidated(AdapterView.java:813) at android.database.DataSetObservable.notifyInvalidated(DataSetObservable.java: 43) at android.widget.BaseAdapter.notifyDataSetInvalidated(BaseAdapter.java: 54) at android.widget.CursorAdapter $MyDataSetObserver.onInvalidated(CursorAdapter.java:391) at android.database.DataSetObservable.notifyInvalidated(DataSetObservable.java: 43) at android.database.AbstractCursor.deactivateInternal(AbstractCursor.java: 89) at android.database.AbstractCursor.deactivate(AbstractCursor.java:78) at android.database.BulkCursorToCursorAdaptor.deactivate(BulkCursorToCursorAdaptor.java: 111) at android.database.BulkCursorToCursorAdaptor.requery(BulkCursorToCursorAdaptor.java: 154) at android.database.CursorWrapper.requery(CursorWrapper.java:211) at MyActivity$2.doInBackground(MyActivity.java:110) at android.os.AsyncTask$2.call(AsyncTask.java:185) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) Code used: // requery in non-UI thread new AsyncTask() { protected Object doInBackground(Object... params) { mCursor.requery(); // exception is thrown here return params; } } Thanks in advance, Gennadi Kudrjavtsev -- 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] Connect tow Emulators on same machine
my machine is running window 7 i have running two android emulators AVD1 and AVD2 AVD1 is for server application and listening on ip 10.0.2.15 and port 8080 AVD2 is for client application and when it tries to connect with server it gives exception on following line Socket socket = new Socket(10.0.2.15,8080); unable to connect with 10.0.2.15 does any body can help me how can i conect two emulators thanx in advance -- 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: Apps missing in publisher console
Yeah me too, just published an app and 1 sec later it was gone ;S On 24 Nov, 22:04, Robert Green rbgrn@gmail.com wrote: I'm currently missing 4 of my apps! Is anyone else having this problem? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Miss apps after Andriod market update
I found some of my apps missed in the console after pagination, and it still exists in the Android Market. It seems that all apps with similar name will be filtered. For example, one of my app name is Smart Vibrator (for 1.5), then another app named Smart Vibrator (for 1.6+) was missed. All missed apps are seems caused by same reason. Does Android Market don't allow simillar app name? -- 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] [Android] If modify framework layer code, how to debug it validly?
checkon automatic debug option On Thu, Nov 25, 2010 at 2:13 PM, Dianne Hackborn hack...@android.comwrote: You should ask these kinds of questions in android-porting. On Thu, Nov 25, 2010 at 12:36 AM, kevens hao ithjf.kev...@gmail.comwrote: Now i modify framework code in source code, so every time i must rebuild the whole source code and view the result. Any debug skill to improve the effect? Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- With regards, Lakshmi -- 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: adb can't find my Verizon Samsung Galaxy Tab ...
Anyone know how to get the Tab recognized on a Mac? I have USB debugging turned on, installed the latest Android SDK, installed the Galaxy Tab add-on in Eclipse, rebooted the Mac and the Tab, but adb still doesn't see it. I probably need a driver, right? I don't see one anywhere for the Mac. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Android 2.2 VGA StatusIcon be Scaled in drawable-lpdi layout-small
I have a problem about resources(drawable-ldpi,layout-small in framework) be scaled Display On screen. we develop Android Phone on QVGA ,According toSupporting Multiple Screens, 1) I add ro.sf.lcd_density = 120 2) I modify PRODUCT_LOCALES= es_ES ldpi mdpi 3) I add res/drawable-ldpi and res/layout-small in packages/apps/, 4) I add res/drawable-ldpi and res/layout-small in framework/base/core/ res/res and make =j4 emulator -skin QVGA I find that resources drawble-ldpi in framework/../res/drawable-ldpi/ is scaled down displayed. resources drawble-ldpi in packages/apps can corrctly be display. Why :resources drawble-ldpi in framework/../res/drawable-ldpi/ is scaled down displayed? Please help,thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: ContentProvider and Location-based services
Thanks you your reply. I have no problems on filtering locations. I'm juste wondering what's the best way of doing it. If I do some filtering in the SQL query, I will have to query a lot of times as user location change. On the contrary, If the contentProvider returns the whole list without filtering, I will have unnecessary data, but only one query. If I do some SQL query filtering, how do I pass longitude and latitude ? Does content://.../longitude/latitude isn't a bit weird ? Thanks Guillaume On Nov 24, 10:33 pm, Kostya Vasilyev kmans...@gmail.com wrote: ContentProvider doesn't have anything to do with locations. It's an abstraction for data access with some useful functionality (like cross-application data access, data change notifications, etc.). You could implement your own, and it could be useful if you wanted to access your data from multiple activities. But it's not necessary, strictly speaking - unless you wanted to expose this data to other applications in a definedway. Now as for location filtering - I'd try and do some rough filteringrightin the SQL query (perhaps based on a box aligned along the latitude / longitude grid), then perform fine filtering based on actual distance calculations (a circle centered on current position) on that data. For computing the distance (for fine filtering) you could use this: http://developer.android.com/reference/android/location/Location.html..., double, double, double, float[]) -- Kostya 24.11.2010 20:01, Guillaume пишет: Hi all, I need some help on how to show nearest locations, therightway. I have in my DB a list of locations. I want to show the n nearest locations (n choosen by the user) with some filters (show only favorites, show only open etc...). I think I should create a ContentProvider, but where do I do the filtering ? Does the contentProvider has to send only the wanted locations, or should he return the whole list, and so the mapView should filtering locations by itself ? Thanks for your help, Guillaume -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.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] Re: Change Activity in Tabs on Button Click
Hi There, can you please give a sample snip of code on how you did the switching between the activities using the static method? Thanks Rames.P. On Nov 23, 4:34 pm, manu_bet manue...@gmail.com wrote: I did that by static method in TabActivity On 23 nov, 10:34, skink psk...@gmail.com wrote: Kumar Bibek wrote: Currently this is not supported. Kumar Bibek Why not? If activity that is bound to Tab1 is ActivityGroup you can easily do it. pskink -- 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] Interpret Logcat Output
Hi guys, I tried searching for an article or post which talks about interpreting/understanding logcat output. I keep getting an Application Not Responding window. I found out that it currently is shown in two main places: when the window manager waits to long on an event it has dispatched to an application, and when the activity manager waits too long on a serialized broadcast it has sent to an application (thus delaying any other recipients of the broadcast). I want to know if there is any way to find out what caused the ANR. Is there any way to interpret the logcat output after an ANR ? The specific output I get after an ANR is as below W/ActivityManager( 67): Activity idle timeout for HistoryRecord{43e7caa0 com.example.android.lunarlander/.LunarLander} W/WindowManager( 67): Key dispatching timed out sending to com.example.android.lunarlander/ com.example.android.lunarlander.LunarLander W/WindowManager( 67): Previous dispatch state: {{KeyEvent{action=0 code=20 repeat=0 meta=0 scancode=105 mFlags=8} to Window{43ee71e8 com.example.android.lunarlander/ com.example.android.lunarlander.LunarLander paused=false} @ 1290642733679 lw=Window{43ee71e8 com.example.android.lunarlander/ com.example.android.lunarlander.LunarLander paused=false} lb=android.os.binderpr...@43ee6fc8 fin=false gfw=true ed=true tts=0 wf=true fp=false mcf=Window{43ee71e8 com.example.android.lunarlander/ com.example.android.lunarlander.LunarLander paused=false}}} W/WindowManager( 67): Current dispatch state: {{KeyEvent{action=1 code=20 repeat=0 meta=0 scancode=105 mFlags=8} to Window{43ee71e8 com.example.android.lunarlander/ com.example.android.lunarlander.LunarLander paused=false} @ 1290642743795 lw=Window{43ee71e8 com.example.android.lunarlander/ com.example.android.lunarlander.LunarLander paused=false} lb=android.os.binderpr...@43ee6fc8 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{43ee71e8 com.example.android.lunarlander/ com.example.android.lunarlander.LunarLander paused=false}}} I/Process ( 67): Sending signal. PID: 354 SIG: 3 I/dalvikvm( 354): threadid=3: reacting to signal 3 What is meant by Previous dispatch state Current dispatch state ? Which source file actually prints W/WindowManager ? How to understand the above output ? Thanks for your time and help. Rohit -- 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 convert JPEG file to PGM format in android ?
I'm implementing face recognition system in android with PCA method I must convert JPEG face image to PGM format. Is there possible to do this in Android? If so how would one do it? I've been searching it's possible to use JAI ImageIO to convert but the problem is Android doesn't support these class. Pardon my English, Thank you in advance. Eka -- 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] Process crash (signal 11) on image handling
I have 3 image resources in my app. Loading and displaying any one of them in an ImageView goes smoothly. But when I remove the displayed ImageView from the layout, null it and add a new image, things get weird. Either the process crashes completely (signal 11) when I try calling .recycle() on the old bitmap or I get an OutOfMemoryError in case I don't use recycle. This only happens on API Levels below 8, so my guess is that bugs with GC on the native heap are causing it and these bugs were fixed on 2.2. However, since 2.1 is currently the most common version out there I need a workaround... Again, there shouldn't be a lack of memory for the native heap. I hold only 1 image at a time and null the previous so the GC should be able to retrieve the heap space (like happens on 2.2). I've created a very small sample app which can be downloaded from here: http://www.4shared.com/file/QqHrhJLR/BitmapRecycleTest.html Any suggestions will be appreciated. -- 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 load jar file automatically by installing apk
you can check whenever it is available by opening the apk file with a archiving tool On Nov 24, 10:01 pm, Mark Murphy mmur...@commonsware.com wrote: Step #1: Put the JAR in your project libs/ directory Step #2: Add it to your build path in Eclipse Everything else will be taken care of for you. On Wed, Nov 24, 2010 at 7:48 AM, kishore vaddekish...@gmail.com wrote: Hi, I am new to android.I had tried created a jar which contains all my native method implemetations.This jar is included in project through eclipse.And i generated .apk. But what my problem is whenever I am installing .apk.. jar file was not loaded in to the device automatically. While running it is throwing unspecified linker error exception for the class defined in the .jar. This might be silly mistake...please suggest the sloution. Please do the needful. Thanks and Regards, Kishore -- 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 -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android App Developer Books:http://commonsware.com/books -- 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] GPS Position realtime
yes,MyLocationOverlay,and the arrow icon is a ball on android. On Thu, Nov 25, 2010 at 4:39 AM, Mark Murphy mmur...@commonsware.com wrote: There is MyLocationOverlay. Other than that, you are on your own. On Wed, Nov 24, 2010 at 8:51 AM, Julien soad0...@gmail.com wrote: Hello I would like to put the same blue arrow icon that is in Google Map on android displaying the current position. Is there anything provided with the google map API to display it over a google map ? (display in real time our position AND direction) I cannot find anything on the internet .. thanks for some help! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android App Developer Books: http://commonsware.com/books -- 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] GPS Position realtime
But it doesnt show the same arrow as in Google Map! It is not possible ?? I find it very usefull as it show in which direction you are looking at. Instead, I have a basic blue circle. On 24 November 2010 21:39, Mark Murphy mmur...@commonsware.com wrote: There is MyLocationOverlay. Other than that, you are on your own. On Wed, Nov 24, 2010 at 8:51 AM, Julien soad0...@gmail.com wrote: Hello I would like to put the same blue arrow icon that is in Google Map on android displaying the current position. Is there anything provided with the google map API to display it over a google map ? (display in real time our position AND direction) I cannot find anything on the internet .. thanks for some help! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to 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 -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android App Developer Books: http://commonsware.com/books -- 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] can we upgrade phone from 2.1 to 2.2
Yes you can. But it needs a bit of research and effort. :) There are lots of resources on the web which explain how to do it. Search for them. Try Cynanogen forums. Kumar Bibek http://techdroid.kbeanie.com http://www.kbeanie.com On Mon, Nov 29, 2010 at 2:01 PM, akshay kesharwani akesharwan...@gmail.comwrote: i m xtremely sorry as i dont have knowledge so i csn not sgt u abt the ph. -- 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
[android-developers] Need your help to clarify CTS 2.2_r3 failure test case issues on Froyo.
Hi all, I'm run default CTS test plan on emulator and my device but it always gets failure on those two test cases of CtsTextTestCases test package: (1).android.text.method.cts.BaseKeyListenerTest - testBackspace (2).android.text.method.cts.BaseKeyListenerTest - testPressKey Below are error log information from DDMS: (1). android.text.method.cts.BaseKeyListenerTest#testBackspace...(fail) junit.framework.ComparisonFailure: expected:1... but was:... at android.text.method.cts.BaseKeyListenerTest.testBackspace(BaseKeyListenerTest.java: 131) at android.text.method.cts.BaseKeyListenerTest.testBackspace(BaseKeyListenerTest.java: 131) at java.lang.reflect.Method.invokeNative(Native Method) at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java: 204) at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java: 194) at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java: 186) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154) at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java: 520) at android.app.Instrumentation $InstrumentationThread.run(Instrumentation.java:1447) at android.text.method.cts.BaseKeyListenerTest.testBackspace(BaseKeyListenerTest.java: 131) at java.lang.reflect.Method.invokeNative(Native Method) at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java: 204) at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java: 194) at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java: 186) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154) at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java: 520) at android.app.Instrumentation $InstrumentationThread.run(Instrumentation.java:1447) (2). android.text.method.cts.BaseKeyListenerTest#testPressKey...(fail) junit.framework.ComparisonFailure: expected:1... but was:... at android.text.method.cts.BaseKeyListenerTest.testPressKey(BaseKeyListenerTest.java: 223) at android.text.method.cts.BaseKeyListenerTest.testPressKey(BaseKeyListenerTest.java: 223) at java.lang.reflect.Method.invokeNative(Native Method) at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java: 204) at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java: 194) at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java: 186) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154) at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java: 520) at android.app.Instrumentation $InstrumentationThread.run(Instrumentation.java:1447) at android.text.method.cts.BaseKeyListenerTest.testPressKey(BaseKeyListenerTest.java: 223) at java.lang.reflect.Method.invokeNative(Native Method) at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java: 204) at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java: 194) at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java: 186) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154) at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java: 520) at android.app.Instrumentation $InstrumentationThread.run(Instrumentation.java:1447) On first test case, I found when it ran on line 131 assertEquals(1456, mTextView.getText().toString()) and the value of mTextView.getText().toString() is equal to 456 not 1456 on BaseKeyListenerTest class. But it could be passed sometimes. The same situation could be found on second test case. JC -- 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] GPS Position realtime
On Thu, Nov 25, 2010 at 6:38 AM, Julien Moine julien.moine...@utbm.frwrote: But it doesnt show the same arrow as in Google Map! It is not possible ?? Subclass MyLocationOverlay, call super.draw(), then draw your own arrow. - 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 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: Send video through socket and playing problem
Hi, All: I have the same issue right now, do you have good solution for that? Could anyone give me any pieces of advices? Thanks a lot. BR, Pico On Nov 20, 3:39 pm, Charlie charliel...@gmail.com wrote: Hi all, I have two simple programmes, one server and one mediaplayer client, both at localhost. The problem is I can send byte/text through thesocket, but when I try to send a video file, from the sdcard to thesocket, the client side mediaplayer cannot play it. Anyone know how to solve this problem? What I send is just first few bytes of the video. Do I need add some packet headers?Thanks. Server: Socketclient=serversocket.accept(); System.out.println(accept); //Receive client message. BufferedReader in=new BufferedReader(new InputStreamReader(client.getInputStream())); String str=in.readLine(); System.out.println(read:+str); //Send message to client. //PrintWriter out=new PrintWriter(new BufferedWriter(new OutputStreamWriter(client.getOutputStream())),true); //out.println(server message); FileInputStream fis=new FileInputStream(/sdcard/ toystory3.3gp); byte buffer[]=new byte[2000]; fis.read(buffer,0,20); DataOutputStream out=new DataOutputStream(client.getOutputStream()); out.write(buffer,0,20); in.close(); out.close(); client.close(); System.out.println(close); Client: Socketsocket=newSocket(127.0.0.1,); String message=Initial+\r\n; //Send message to server. PrintWriter out=new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())),true); out.println(message); //Receive message from server. //BufferedReader br=new BufferedReader(new InputStreamReader(socket.getInputStream())); //String msg=br.readLine(); ParcelFileDescriptor pfd=ParcelFileDescriptor.fromSocket(socket); MediaPlayer m=new MediaPlayer(); m.setDataSource(pfd.getFileDescriptor()); m.prepare(); m.start(); /*if(msg!=null) { System.out.println(Data received.); System.out.println(msg); } else { System.out.println(Data not received.); }*/ out.close(); br.close(); socket.close(); -- 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] Adding New Locale And Translating Android Core
Hello I have been searching the Internet for the past few weeks in order to find out how I can help contribute by translating the Android core apps and adding the Welsh (Cymraeg (cy)) locale. I and a few other friends are interested in undertaking such a project and we'd like to be able to use a web interface such as Pootle, Transifex or Launchpad if possible. Is there any documentation on how to do this as I cannot find it anywhere? Kind regards, Christopher Swift -- 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 use AmrInputStream
I got it working by copying the source to my own project. make sure you leave it is android.media. Because of jni naming convention it wont bind correctly unless it is in this package. On Nov 2, 12:24 am, cindy ypu01...@yahoo.com wrote: I copy the AmrInputStream.java to my application. It can compile, however, it can't run. Do you have any suggestion on how to make AmrInputStream work? Thanks! Cindy On Oct 7, 5:37 pm, Mark Murphy mmur...@commonsware.com wrote: On Thu, Oct 7, 2010 at 8:35 PM, cindy ypu01...@yahoo.com wrote: But you can't import the class into your code: import android.media.AmrInputStream. I think android simulator doesn't have this class. Am I correct? It is not part of the Android SDK. It is part of the firmware. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy Android Training...At Your Office:http://commonsware.com/training -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] What is the Android Sequence of Startup
I have worked my way through an Android book and a half, some of the online documentation, and have an understanding of Java (although I use it seldom because it is so verbose) - but am STILL having trouble getting my head around this stuff. What I would like to know is: How does Android start up an application? Does it: A. Fire up the java code with the same name as the project and then 'filters' activities etc through the Manifest to see if they are allowed. B. Looks at the manifest and then (somehow) decides what java program to start, allowing only those activities etc defined (somehow) in the Manifest. OR C. Something totally different and automagical and I obviously do not yet have a clue. Gus -- 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] Crash when playing a song using mediaplayer
Hello, I am working on a project where I have sound effects and two songs. When I make the transition from one sound to another and spamming touch the application crashes. It seems to be crashing somewhere in the mediaplayer.release(), it doesn't return from here. Every time I start a new sound I make release on the previously played sound and call create on the MediaPlayer again. Have you encountered something similar? 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] Inetaddress.getbyname exception
Dear all, I am facing a problem where InetAddress.getByName, getAllByName are throwing UnknownHostException. I have included the java.net.* packages and I am using an android device to load this code and test and not an emulator. Also, I connect the device on hyperterminal to capture the logs. I read that we must do some 'use-permission' option in the code but am totally unclear on this. When I ping to these hostnames on the system where hyperterminal is up, it just pings fine, meaning the ports are open. Also, I am able to connect if I directly use IPAddress without the conversion from hostname to IP. Please help me resolve this issue. Please revert incase you need anymore details. Regards, aad -- 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: ClassNotFoundException crash reports from Market
Hi Moss com.company.app is just the obfuscated package name (much like your 'com.myweb.myapp'). Of course I'm using a unique package name or at least I hope it is unique ;-). Thanks for your post anyway, I really appreciate any help! Cheers Emanuel On Nov 24, 2:01 pm, Moss b.thax@gmail.com wrote: Could it be that the class loader is failing to find the right package? I just saw that you are using 'com.company.app' as your package name. Googling a bit I found that there are many apps that use the same schema. Normally I use my domain to identify my packages in a unique way like 'com.myweb.myapp'. I just tried to reproduce your error and creating 2 apps that use the same base package name I just get the error when launching them. I think that the class loader will pickup the first listed package and then try to load the class (which is not there :P): - com.package.app.ActivityA - com.package.app.ActivityB If I load com.package.app.ActivityB I'm getting the same error. Hope this can help you a bit. Cheers, Moss -- 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] Handling Camera
Hi am using the following code to get the preview for my camera , but my app getting force closed, dont know y, can anyone help me on this. setContentView(R.layout.camera); final Preview preview = new Preview(getApplicationContext()); FrameLayout layout = (FrameLayout) findViewById(R.id.preview); try{ if(layout!=null preview!=null){ layout.addView(preview); /* Here where my app getting force closed */ }else{ showToast(its null); } }catch(Exception e){ showToast(e.getMessage()); } Thanks and Regards Raju .G -- 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] Google Android Map Overlay
I wrote a sample which jpeg image is displaying when you click the overlay. I think that maybe could be helpful as a reference. (MapViewTouchSample.java) package com.ma.chupic.chu.com.beta.activity; import java.util.ArrayList; import android.content.Context; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.util.Log; import android.widget.Toast; import com.google.android.maps.GeoPoint; import com.google.android.maps.ItemizedOverlay; import com.google.android.maps.MapActivity; import com.google.android.maps.MapView; import com.google.android.maps.Overlay; import com.google.android.maps.OverlayItem; public class MapViewTouchSample extends MapActivity { private Drawable touchedLocationIcon; private TouchedItemizedOverlay touchedItemizedOverlay; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); touchedLocationIcon = getResources().getDrawable(R.drawable.icon); touchedItemizedOverlay = new TouchedItemizedOverlay(touchedLocationIcon, this); ((MapView) findViewById(R.id.MapView)).getOverlays().add(new Overlay() { @Override public boolean onTap(GeoPoint p, MapView mapView) { Log.v(this.getClass().getName(), Overlay.onTap start.); super.onTap(p, mapView); String locationPoint = new StringBuilder() .append(latitude: ) .append(p.getLatitudeE6()) .append(, longitude:) .append(p.getLongitudeE6()) .toString(); OverlayItem overlayItem = new OverlayItem(p, locationPoint, ); touchedItemizedOverlay.clearOverlay(); touchedItemizedOverlay.addOverlay(overlayItem); mapView.getController().animateTo(p); mapView.getOverlays().add(touchedItemizedOverlay); mapView.invalidate(); return true; } }); } @Override protected boolean isRouteDisplayed() { return false; } } class TouchedItemizedOverlay extends ItemizedOverlay { private ArrayListOverlayItem overlays = new ArrayListOverlayItem(); Context context; public TouchedItemizedOverlay(Drawable defaultMarker, Context context) { super(boundCenterBottom(defaultMarker)); this.context = context; } @Override protected boolean onTap(int index) { super.onTap(index); String title = getItem(index).getTitle(); Toast.makeText(context, title, 3).show(); return true; } @Override protected OverlayItem createItem(int i) { return overlays.get(i); } @Override public int size() { return overlays.size(); } void addOverlay(OverlayItem overlay) { overlays.add(overlay); populate(); } void clearOverlay() { overlays.clear(); populate(); } } -- Regards Twitter: @machupicchubeta On Sun, Nov 21, 2010 at 12:41, devian yudha asns.dr...@gmail.com wrote: yeah i think SDK doesn't provide us to that functionality, so you must included other things like .XML which give us a layout resource, etc. On 11/21/10, Frank Weiss fewe...@gmail.com wrote: The Android SDK doesn't provide this functionality ready-to-go, but it can be easily implemented with a custom view class that extends FrameLayout, a controller class, a nine-patch image, and a layout resource (XML). You ought to be able to google for several solutions. Try the keyords mapview and balloon. IMO implementing it yourself is a valuable exercise that adds to your understanding of the Android SDK. -- 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 -- 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