[android-beginners] draw() vs onDraw()
Hi, I am implementing my custom view in which I extend LinearLayout, add some children, and do some paintings over them. when I override onDraw method, I found my painting is done below children components but I want my painting o be over children component. Instead I tried to override the draw() method itself. It works and now, my paintings are over the children components. But I found JavaDoc says don't override draw(), instead override onDraw(). Is there a way to do what I want without overriding draw() itself (by overriding onDraw()). Also, why shouldn't I override draw() itself? thanks in advance -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Bluetooth on Android 2.0 emulator
Hello, Have anyone success on trying bluetooth stuff on android 2.0 emulator? If not, could anyone get an android 2.0 image that can run on ADP1 and supports bluetooth? thanks in advance -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re-locating a dialog
Hello, I have an alert dialog which I got using AlertDialog.Builder (context).create(). When I call alertDialog.show(), it appears centered on screen (horizontally and vertically). Can I control its position? for example, I want to make it appear on top of screen to still show its parent window. How could this be done? thanks in advance. -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] declaring a service
hello, I am trying to run service example. I declare a service in a project and want to call the service from an activity that exists in another project. in first project, my AndroidManifest.xml looks like this http://schemas.android.com/apk/res/android"; package="com.mypackage.service_server"> the CalculatorService class extends the Service class and its onBind method looks like this public IBinder onBind(Intent intent) { if(calculator == null) { calculator = new CalculatorImpl(); } return calculator; } The CalculatorImpl class extends Calculator.Stub class and Calculator.java is generated from Calculator.aidl. in the other project, in the activity onCreate there is a code like this Intent intent = new Intent(Calculator.class.getName()); boolean connected = bindService(intent, connection, BIND_AUTO_CREATE); the method bindService returns false. what is missing in my both projects? note: the Calculator.java file is shared between both projects by a symlink. thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Get activity current view
Hello all, I am wondering is there a way to ask an activity or dialog for its currently displayed view? I tried getCurrentFocus() but it returns null! any clues? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: RMS in android
Have you looked at MicroEmulator? review this blog it contains many examples http://microemu.blogspot.com/ On Jul 23, 8:27 pm, "Balwinder Kaur (T-Mobile)" wrote: > There are some options that may help you do it. I would just google > for "J2ME to Android Porting" and evaluate them. > > There is nothing that I can recommend or endorse. > > Balwinder Kaur > Open Source Development Center > ·T· · ·Mobile· stick together > > The views, opinions and statements in this email are those of the > author solely in their individual capacity, and do not necessarily > represent those of T-Mobile USA, Inc. > > On Jul 23, 8:53 am, xventure wrote: > > > Thank for the prompt reply, > > > I am having one application running j2me, i want to port it android, > > is there any cross platform compiler that convert all the codes to > > android supported? > > > Regards, > > Xve > > > On Jul 23, 7:20 pm, "Balwinder Kaur (T-Mobile)" > > mobile.com> wrote: > > > RMS is a MIDP concept. > > > > For Data Storage in Android, check > > > outhttp://developer.android.com/guide/topics/data/data-storage.html > > > > Cheers, > > > Balwinder Kaur > > > Open Source Development Center > > > ·T· · ·Mobile· stick together > > > > The views, opinions and statements in this email are those of the > > > author solely in their individual capacity, and do not necessarily > > > represent those of T-Mobile USA, Inc. > > > > On Jul 23, 8:01 am, xventure wrote: > > > > > Hi, > > > > > in j2me we use RMS, how about in Android? Any example on how to use > > > > RMS in android? > > > > > Thanks for the answer, > > > > > Xve > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Get file name from Uri
Thank you very much. this is exactly what I want. thanks again. On Jul 22, 11:38 pm, Kacper86 wrote: > Hi, > > Firstly, I'd like to recommend this article: > http://developer.android.com/guide/topics/providers/content-providers... > > Secondly, let's solve your problem (which you can solve on your own > after reading the article). The Uri is not supposed to carry a large > amount of data. You don't cast it to huge objects and directly query > it for the information. Think of it as an address. When you have an > address and a mean of transport you can get there and find whatever > you're looking for. To the point, if you have an Uri, you can use > Cursor and make a proper query, which can look like this: > > > Uri u = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; > Uri u2 = Uri.withAppendedPath(u, "1"); > > // this is what you have > // u2 == content://media/external/images/media/1 > > String[] projection = { MediaStore.Images.ImageColumns.DATA, / > *col1*/ > MediaStore.Images.ImageColumns.DISPLAY_NAME > /*col2*/}; > > Cursor c = managedQuery(u2, projection, null, null, null); > if (c!=null && c.moveToFirst()) { > String column0Value = c.getString(0); > String column1Value = c.getString(1); > Log.d("Data",column0Value); > Log.d("Display name",column1Value); > } > > > Obviously, you can reduce number of columns to the one you need the > most. The less number of columns we have to return, the more efficient > it will get. > > On Jul 22, 8:41 pm, Mina Shokry wrote: > > > thank you for this great help but unfortunately this isn't my case. > > not me who created the cursor and iterate through it. I am just > > receiving the Uri from another activity via an intent. and it isn't > > good to iterate through all images to find one its Uri matches one I > > received especially that I am not sure it will always be a Uri of an > > image. > > > still can I get the file name? > > > On Jul 22, 4:04 pm, Kacper86 wrote: > > > > Hi, > > > > The problem is that it should be documented in the Android Reference, > > > here: > > > >http://developer.android.com/reference/android/provider/MediaStore.Im.. > > > > But, as far as i understand, it's not complete. Fortunately, we can > > > check it in a different way. > > > > > > > Uri u = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; > > > //sdcard only > > > Cursor c = managedQuery(u, null, null, null, null); > > > > if (c.moveToFirst()) { > > > do { > > > int max = c.getColumnCount(); > > > for (int i = 0; i < max; i++) { > > > String colName = > > > c.getColumnName(i); > > > String value = c > > > > > > .getString(c.getColumnIndex(colName)); > > > > if (colName != null){ > > > Log.d("columnName: ", > > > colName); > > > } > > > > if (value != null) { > > > Log.d("value", value); > > > } > > > } > > > } while (c.moveToNext()); > > > } > > > > > > > Check LogCat and you'll notice that we have all column names with > > > their values. I suppose, you'd be interested in: > > > > 07-22 12:50:09.973: DEBUG/columnName:(3049): _data > > > 07-22 12:50:09.973: DEBUG/value(3049): /sdcard/download/vienna-s- > > > schonbrunn-zoo-and-giant-ferris-wheel-in-vienna-1.jpg > > > (...) > > > 07-22 12:50:09.983: DEBUG/columnName:(3049): _display_name > > > 07-22 12:50:09.983: DEBUG/value(3049): vienna-s-schonbrunn-zoo-and- > > > giant-ferris-wheel-in-vienna-1.jpg > > > > If you have got any questions, don't hesitate to ask. > > > > Greetings! > > > >
[android-beginners] Re: Get file name from Uri
thank you for this great help but unfortunately this isn't my case. not me who created the cursor and iterate through it. I am just receiving the Uri from another activity via an intent. and it isn't good to iterate through all images to find one its Uri matches one I received especially that I am not sure it will always be a Uri of an image. still can I get the file name? On Jul 22, 4:04 pm, Kacper86 wrote: > Hi, > > The problem is that it should be documented in the Android Reference, > here: > > http://developer.android.com/reference/android/provider/MediaStore.Im...http://developer.android.com/reference/android/provider/MediaStore.Im... > > But, as far as i understand, it's not complete. Fortunately, we can > check it in a different way. > > > Uri u = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; > //sdcard only > Cursor c = managedQuery(u, null, null, null, null); > > if (c.moveToFirst()) { > do { > int max = c.getColumnCount(); > for (int i = 0; i < max; i++) { > String colName = c.getColumnName(i); > String value = c > > .getString(c.getColumnIndex(colName)); > > if (colName != null){ > Log.d("columnName: ", > colName); > } > > if (value != null) { > Log.d("value", value); > } > } > } while (c.moveToNext()); > } > > > Check LogCat and you'll notice that we have all column names with > their values. I suppose, you'd be interested in: > > 07-22 12:50:09.973: DEBUG/columnName:(3049): _data > 07-22 12:50:09.973: DEBUG/value(3049): /sdcard/download/vienna-s- > schonbrunn-zoo-and-giant-ferris-wheel-in-vienna-1.jpg > (...) > 07-22 12:50:09.983: DEBUG/columnName:(3049): _display_name > 07-22 12:50:09.983: DEBUG/value(3049): vienna-s-schonbrunn-zoo-and- > giant-ferris-wheel-in-vienna-1.jpg > > If you have got any questions, don't hesitate to ask. > > Greetings! > > On Jul 22, 10:28 am, Mina Shokry wrote: > > > Hello, > > > I am using content provider to access images in phone gallery and > > everything works fine except one thing that I want to get the physical > > file name of images I access. Can I get a java.io.File object from > > android.net.Uri object? > > if no, is there any other way to accomplish such a task? > > I just need to know the file name! > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Get file name from Uri
Hello, I am using content provider to access images in phone gallery and everything works fine except one thing that I want to get the physical file name of images I access. Can I get a java.io.File object from android.net.Uri object? if no, is there any other way to accomplish such a task? I just need to know the file name! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Developing software libraries
Hi all, I want to develop a class library for android platform. I mean developing a .apk (or jar. it doesn't matter) that doesn't contain activities but just a library that other applications can use its classes. can I? I think this is possible because I see a section in market called "software libraries". but I don't know how to start? another question please. now we have android-ndk. Is making this library making some native calls possible? if yes, does id differ from making native calls from normal applications. thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Rooting ADP1 holiday edition
Hi, I got an ADP1 but not from google (from ebay) and I think it is holiday edition that was with a google employee. when I got it, it was on version 1.1. In my first day with it, it notified me that an upgrade to 1.5 is available and it downloaded and installed it. Now, I found myself don't have root on terminal. when executing "adb - d root" I get message "adbd cannot run as root in production builds". and also I can not access paid applications in the android market! I don't know if my phone now is a developer phone or a normal phone?!! Settings -> About Phone reports this Model number: Android Dev Phone 1 Firmware version: 1.5 Kernel Version: 2.6.27-00393-g6607056 s...@sandroid #1 Build number: CRB43 how can I have root permissions on shell? have I to re-flash the phone? if yes, what image should I use? will I lose my installed apps and my configurations I did on the phone? thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Android on Ubunty 9.04
Without changing anything, I tried it again today and it works. thanks you all! On May 26, 1:37 pm, Sean Hodges wrote: > Mina, > > Wonglik's instructions worked for me, on Ubuntu 9.04, 64bit. > > You may have forgotten to check the execute flag on both files: > > cp /etc/udev/rules.d/50-android.rules /etc/udev/rules.d/51-android.rules > chmod a+rx /etc/udev/rules.d/*-android.rules > /etc/init.d/udev reload > > If you're still having problems, please post up an "ls -l" listing of > your rules.d directory, and the contents of your rules files. > > Regards, > > Sean > > On Mon, May 25, 2009 at 3:07 PM, Mina Shokry wrote: > > > I had same on ubuntu 9.04. I did the copy and still doesn't work. > > > I am using 64-bit edition. is this related? > > > On May 25, 1:53 pm, hgschmidt > > wrote: > >> Had the same problem: Upgrade to 9.04 and couldn't connect to G1 > >> anymore. > > >> Copying the file, as mentioned, worked fine. > > >> On Apr 27, 12:00 pm, wonglik wrote: > > >> > I found some post suggesting copying (not renaming) > > >> > /etc/udev/rules.d/50-android.rules. > > >> > to > > >> > /etc/udev/rules.d/51-android.rules. > > >> > It helps. > > >> > regards > >> > w > > >> > On Apr 27, 12:07 pm, Sean Hodges wrote: > > >> > > I'll be upgrading in the next couple of days, if you don't get your > >> > > answer already by then I'll let you know how I get on. > > >> > > On Sat, Apr 25, 2009 at 11:10 AM, wonglik wrote: > > >> > > > Hi > > >> > > > Does anybody have a problem connecting G1 to Ubuntu 9.04? > > >> > > > It was working fine for me on 8.04 but now I just can not connect to > >> > > > it. > > >> > > > adb devices > > >> > > > just show empty list. > > >> > > > I have added > > >> > > > SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666" > > >> > > > to > > >> > > > /etc/udev/rules.d/50-android.rules > > >> > > > and run : > > >> > > > chmod a+rx /etc/udev/rules.d/50-android.rules > > >> > > > but it did not help. > > >> > > > Any body have any idea? > > >> > > > Kind regards > >> > > > w > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Android on Ubunty 9.04
I had same on ubuntu 9.04. I did the copy and still doesn't work. I am using 64-bit edition. is this related? On May 25, 1:53 pm, hgschmidt wrote: > Had the same problem: Upgrade to 9.04 and couldn't connect to G1 > anymore. > > Copying the file, as mentioned, worked fine. > > On Apr 27, 12:00 pm, wonglik wrote: > > > I found some post suggesting copying (not renaming) > > > /etc/udev/rules.d/50-android.rules. > > > to > > > /etc/udev/rules.d/51-android.rules. > > > It helps. > > > regards > > w > > > On Apr 27, 12:07 pm, Sean Hodges wrote: > > > > I'll be upgrading in the next couple of days, if you don't get your > > > answer already by then I'll let you know how I get on. > > > > On Sat, Apr 25, 2009 at 11:10 AM, wonglik wrote: > > > > > Hi > > > > > Does anybody have a problem connecting G1 to Ubuntu 9.04? > > > > > It was working fine for me on 8.04 but now I just can not connect to > > > > it. > > > > > adb devices > > > > > just show empty list. > > > > > I have added > > > > > SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666" > > > > > to > > > > > /etc/udev/rules.d/50-android.rules > > > > > and run : > > > > > chmod a+rx /etc/udev/rules.d/50-android.rules > > > > > but it did not help. > > > > > Any body have any idea? > > > > > Kind regards > > > > w --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Internet through ad-hoc wifi
Hi all, I saw many threads on web talking about using G1 phone as modem to give internet to laptops. but my problem is the reverse and I can not find any threads on web talking in this. I have a wired internet connection that I use with my laptop and my laptop has a wifi card. I could make a shared wifi connection that I am able to use from other mobile phones like Nokia N81. and the nokia phone can get internet through this connection. My problem is that I want my android phone (developer phone) to get internet using same approach (i.e through an ad-hoc wifi connection to the laptop that has wired internet access). can I? when I do a wifi scan from the android phone, it doesn't discover this shared wifi connection also entering connection ID manually doesn't work.. any help is much appreciated. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---