[android-developers] Re: Help me to test APK file on your real device
Hi Ulziisaikhan, There's a (fairly) new service that enables developers to test their mobile application on a real device by a variety of different testers: http://www.testarmy.com/ If you can't obtain (or afford) a real Android device then this could be a cheap option. Regards, Peter On Oct 10, 8:44 pm, Ulzii [EMAIL PROTECTED] wrote: Hi All, I have finished an application for the Android platform device. I am writing from Ulaanbaatar, Mongolia. It means there is no possibility to test apk file on real android gPhone device. Is there anyone who obtained gPhone, could you help me to test my APK file on your device. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] How, when do I join Android Developer Challenge II?
How do I join the second Android developer challenge? When is the deadline? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Fwd: Emulator crash
Forwarding this to android-developers as I didn't get a response on android-beginners. Any suggestions appreciated. -- Forwarded message -- Hi all, I'm having a problem with the emulator on windows. Everything was running fine until about a week ago. Every time I try to run an application within Eclipse the emulator crashes (with a standard windows emulator.exe has encountered a problem... error). There is nothing written in logcat and the last message on the console is Launching a new emulator, again with no errors. I can successfully open the emulator from a shell. Once the emulator is open I can successfully run an application from Eclipse. Assuming it was an eclipse related issue I tried re-installing both eclipse and the android plugin but with no luck. It wouldn't be such a big deal (since I can just run the emulator before loading up eclipse) but now I'm noticing other errors creeping up which didn't exist before so I'm concerned there's something else going on. Does anyone have any insight as to what might be causing this? Thanks, Ben --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: G1 linux
True, but if his phone has upgraded to RC30 yet, then he could get root access and install debian alongside android which is detailed here http://www.saurik.com/id/10. Another possibility would be to hope that Android is upgraded to allow access to the bluetooth hardware through the SDK. Then you could right a little java app to get the job done. On Nov 18, 3:07 pm, Diego Torres Milano [EMAIL PROTECTED] wrote: On Nov 18, 11:51 pm, Rui Freitas [EMAIL PROTECTED] wrote: Hi, I wanna now if is it possible to program for the G1 like a linux device. If so, how can i do it? Where can i find that kind of information? Android is based on a Linux kernel but strictly speaking it's not Linux. Android has no native windowing system, no glibc support and doesn't include all of the libraries and utilities usually available in a Linux system. Thanks, Rui- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Android and bluetooth
On Sat, Nov 22, 2008 at 2:03 AM, Mark Murphy [EMAIL PROTECTED]wrote: developer wrote: Its really surprising me that android has no support for bluetooth Android has support for Bluetooth. Android does not have APIs for developers to use Bluetooth at this time. http://android-developers.blogspot.com/2008/08/some-information-on-apis-removed-in.html I can see the prudence of the API designers of not introducing the API, knowing that it's going to change very soon. However, this is still an unfortunate thing, and I hope that a new version of SDK that includes BT API would be released soon. csp --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Avoiding onItemSelected calls during initialization
I have code like: void init() { spinner.setOnItemSelectedListener(null); spinner.setAdapter(prioritiesAdapter); spinner.setSelection(task.getPriority() - 1); spinner.setOnItemSelectedListener(this); } @Override public void onItemSelected(AdapterView? parent, View v, int position, long id) { Log.d(TAG, itemSelected: + position); } I would expect that I would *not* see debug messages during initialization, because I explicitly remove the listener before I call setSelection() and put it back after I'm done. However, I *do* see the debug messages anyway. It's as if the selection setting is getting queued up and running later. So how do I make sure that my event handlers don't run during (re) initialization? Thanks in advance, Dave Orme --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Initiating CSD connections?
Does anyone have information about initiating Circuit Switched Data connections from Android? I don't see any part of the API that provides this functionality, but maybe there's a character device that I can access directly on the G1? Thanks, - D --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Anyway we can get a maps binary that works with the open source code?
Hi,I am running Android on my HTC Vogue/Sprint Touch to great success! A kind fellow in New Zealand named Martin has written drivers for the main hardware and is currently working on camera support. See: http://forum.xda-developers.com/showthread.php?p=2918032 http://www.myhtcphone.com/vogue-cab-installer Now Martin has requested for someone to write to google and request a maps framework binary that will work in the open source code so we can switch to that codebase that allows us to try using Android Marketplace and Gmail binaries and others. Here is the post: http://forum.xda-developers.com/showthread.php?p=2918032#post2918032 Feel free to email me personally (keith at hadm dot net) if you need any other info, or if there's anything I could help you with. Thanks everyone for your guys hard work and I love Android, even if I don't have 3g tmobile coverage. :) Keith Herrington --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Follow this procedure to get the Map as earlier
I have created my fingerprint, got my Google Maps API and have tried to paste the code in and still have the same issue with not being able to see the map. My APIDemos MapView doesn't work either. I see the grid layer and google logo, but no map. Any suggestions? I have scoured the blog and fourm and seen this issue alot but most people don't have their API key it seems. My map view was working a few days ago so that makes me think it is a configuration issue or something. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Use traceview to trace UI unrelated APIs
Hi: I think traceview is a useful tool, when i use it to trace openVideo in VideoViewDemo on Android RI. And the video path is set to a valid one which make Video can be played successfully. I get following log(traceview -r dmtrace.trace): 3 4866 4777 5272 + android/widget/VideoView.openVideo ()V 3 5361 52720 android/widget/VideoView.openVideo ()V 3 5405 5316 5700 + android/view/View.requestLayout ()V I guess it is because TraceView only trace View related APIs (Am I right? And why not let it trace all java APIs?) It seems openVideo not be steped in. I have some questions: 1) Is it possible to let traceview to trace UI unrelated APIs, what need to be modified for it? 2) What is the meaning of V,Z,I at the end of each line? 3) When I launch emulator and press F9, some other format files created. Do traceview can be used to analysis them? Thanks in advance! gan --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] How, when do I join Android Developer Challenge II?
How do I join the second Android Developer Challenge? When is the deadline? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Binding a GridView to a provider?
i'm trying to bind a GridView to a collection of image thumbnails from the MediaStore provider. my impression is that i need to create a cursor via a managed query, then create an adapter from that, and assign that adapter to the GridView. can anyone show me how to do this? the documentation is not terribly clear on this. 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Avoiding onItemSelected calls during initialization
void init() { spinner.setOnItemSelectedListener(null); spinner.setAdapter(prioritiesAdapter); spinner.setSelection(task.getPriority() - 1); spinner.setOnItemSelectedListener(this); } setAdapter() is not a blocking call. The items and the selection are set in the spinner on the first layout, which happens *after* your call to pinner.setOnItemSelectedListener(this). So how do I make sure that my event handlers don't run during (re) initialization? Your event handler doesn't run during initialization. It runs on the first layout. -- Romain Guy www.curious-creature.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Eclipse repo is down?
Hi all, There is no Eclipse repo available here: https://dl-ssl.google.com/android/eclipse/ Bogo --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: missing javax audio?
Thank you Dianne. The media player application source is available; I was not aware of that as I (and I guess some others too) could not find it while browsing and searching through http://android.git.kernel.org/ . Where exactly can we find it? Thanks. this discussion seems to be rooted on the view that google is the only one who can help us, when this is no longer the case and anyone can contribute. This was based on the (apparently wrong) assumption that the MediaPlayer source code is not available. Of course there can be a separate discussion on who should do the work. as David has said the things being asked for here are already well known limitations that effort is being put in to addressing. Excellent! By and large, all of the things being asked for aren't missing because they weren't deemed important, but simply because doing them is not trivial and will take significant effort to accomplish. I think we all understand and respect that. That is also why I think a deep understanding of the Android framework is needed to do this right. One can hardly expect that at this stage from third-party Android application developers who simply get stuck with the currently available audio functionality. As such, continual requests to have them added is not going to make that happen any faster. :) I understand. However, sharing some planning information on what is expected when would prevent those continual requests. Add some disclaimers where needed. Right now we only know that Google is aware of the problem and spending effort on it, but we do not have the slightest idea what priority it is given, when the next SDK will come out and when this particular audio problem is scheduled to be fixed. That is an invitation for sending regular reminders because we do not have the foggiest idea what is really going on and when we may expect results. Developers need to know that for their own application development planning, right? Anyway, don't let these discussions distract or discourage you from the real work. We are eagerly waiting for and will appreciate the solid results of your hard work. Regards On Nov 21, 11:21 pm, Dianne Hackborn [EMAIL PROTECTED] wrote: As far as I know, there is nothing related to any of the issues being discussed that is at this point closed source. The media player application source is available; the framework's implementation of MediaPlayer (this is part of the framework, not an application) is certainly all open sourced; and the low-level native PV libraries are all available as source. You can, today, go and download the android open-source project, and starting modifying PV and the framework to support streaming. That was all that I was trying to point out when saying people can submit patches: this discussion seems to be rooted on the view that google is the only one who can help us, when this is no longer the case and anyone can contribute. So if there is some specific feature you absolutely need, in some cases it may be a good use of time to just go and add it instead of asking for others to do so. That all said, I am not that familiar with the media stuff, but as David has said the things being asked for here are already well known limitations that effort is being put in to addressing. By and large, all of the thingsbeing asked for aren't missing because they weren't deemed important, but simply because doing them is not trivial and will take significant effort to accomplish. As such, continual requests to have them added is not going to make that happen any faster. :) -- Dianne Hackborn Android framework engineer [EMAIL PROTECTED] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How, when do I join Android Developer Challenge II?
http://code.google.com/android/adc.html At the moment that's the only thing that's known about ADC II. I think. On Nov 22, 5:57 am, don rhummy [EMAIL PROTECTED] wrote: How do I join the second Android developer challenge? When is the deadline? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Use traceview to trace UI unrelated APIs
Guy: Thanks for the information. About 1) I found my confusion is caused by MediaPlayer java API is invoked outside Debug.startMethodTracingstopMethodTracing. About 2) It is just what I wanted. About 3) I still have question. there are many files created by press F9. qtrace.bb qtrace.exc qtrace.insn qtrace.method qtrace.pid qtrace.static But TraceView seems can only open dmtrace.trace which is a combination of Key FileDataFile described in http://code.google.com/android/reference/traceview.html How can we open qtrace.exc? Thanks for any comments! gan On Nov 22, 4:12 pm, Romain Guy [EMAIL PROTECTED] wrote: 1) Is it possible to let traceview to trace UI unrelated APIs, what need to be modified for it? traceview traces everything but not, at least by default, native code. 2) What is the meaning of V,Z,I at the end of each line? It's the return type of the method (V for void, Z for boolean, I for integer, etc.) 3) When I launch emulator and press F9, some other format files created. Do traceview can be used to analysis them? These files are the tracefiles for traceview. -- Romain Guywww.curious-creature.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to insure the singed file is correct?
adb uninstall yourapp.apk adb install yourapp.apk On Nov 22, 2:40 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: can we test this process on emulator ? if can do, how do it, thanks On Nov 22, 5:03 am, atrus123 [EMAIL PROTECTED] wrote: Hello, If you try and install a signed package on top of a pre-existing unsigned package, you will get this error. To resolve, uninstall the currently existing package from the G1. Sometimes if an install has previously failed, you may have to reinstall the unsigned package and then uninstall in order to remove any left-over files (databases, etc.) Hope this helps, J. On Nov 21, 11:36 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I upgraded my android app version, but user report me Error: Package file was not signed correctly. keytool -genkey -keystore keys/androidrss.keystore-alias androidrss.keystore-keyalg RSA -validity 1 keytool -genkey -v -keystore keys/androidrss.keystore-alias androidrss.keystore-keyalg RSA -validity 1 jarsigner -verbose -keystore keys/androidrss.keystore-signedjar androidrss_signed.apk androidrss.apkandroidrss.keystore I retry this twice, but not fix this problem. can you help me asap?- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Extract some information from an APK file
thank you for the tip Dianne! On Nov 21, 2:52 am, hackbod [EMAIL PROTECTED] wrote: Have a look at the aapt command -- it has a variety of dump sub- commands for printing individual information from the .apk. Not all of this information may currently be (easily) available through the command, so if you need more you can get the open source release and extend the command to dump the other information you want. On Nov 20, 4:53 am, Android Freeware [EMAIL PROTECTED] wrote: Hello, is there a way to extract the following data directly from a compiled and signed APK file: 1) name of the package (e.g. 'com.example.android.app') 2) versionCode (e.g. '1') 3) versionName (e.g. '1.0.0') 4) path to the application icon (e.g. '/res/drawable/icon.png') Thank you 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: missing javax audio?
The media player application source is available; After wading through plenty of audio glue and interfacing code in various code branches, I think that what we meant by MediaPlayer in the discussions is mostly situated in AudioFlinger, AudioHardwareGeneric, AudioTrack and AudioRecord? I.e., libs/ audioflinger/AudioFlinger.cpp, libs/audioflinger/ AudioHardwareGeneric.cpp, media/libmedia/AudioTrack.cpp and media/ libmedia/AudioRecord.cpp at http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=libs/audioflinger/AudioFlinger.cpp, http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=libs/audioflinger/AudioHardwareGeneric.cpp, http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=media/libmedia/AudioTrack.cpp, http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=media/libmedia/AudioRecord.cpp, respectively. Thanks On Nov 22, 9:57 am, blindfold [EMAIL PROTECTED] wrote: Thank you Dianne. The media player application source is available; I was not aware of that as I (and I guess some others too) could not find it while browsing and searching throughhttp://android.git.kernel.org/ Where exactly can we find it? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Help!!the fonts width and height???Thanks!
I have a TextView, if i want calculate how many characters in a line, must be get the textview width and the char width, then calculate the result ! Now i how the width, don't know a char width! Some one can help me??? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Java IO is super-slow in Android -- why?
Phones in general do not have super fast CPUs like laptop and desktops. Android runs on a phone CPU which is not very fast. Overall you will see that programs dont necessarily run at the same speed as on a laptop. - Sunit Katkar http://sunitkatkar.blogspot.com/ - Android OS Tutorials On Fri, Nov 21, 2008 at 8:08 PM, __ [EMAIL PROTECTED] wrote: I measure the speed of copying files to/from the SD card at about 5MB/ sec on my G1, however the following speed test tops out at about 250kB/ sec read and 125kB/sec write. (The example shown writes to the internal SD card, but writing to the removable card is about the same speed.) Why is it so slow? (Using NIO channels to write whole arrays of bytes doesn't speed it up by much...) -- long startTime = System.currentTimeMillis(); BufferedOutputStream writer = new BufferedOutputStream(openFileOutput (speedtest, MODE_PRIVATE)); int size = 100; for (int i = 0; i size; i++) writer.write((byte) 0); writer.close(); Log.i(speedtest, speed test a: + (System.currentTimeMillis() - startTime)); startTime = System.currentTimeMillis(); BufferedInputStream in = new BufferedInputStream(openFileInput (speedtest)); for (int i = 0; i size; i++) in.read(); in.close(); Log.i(speedtest, speed test b: + (System.currentTimeMillis() - startTime)); startTime = System.currentTimeMillis(); --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Do you know the Android Developers
Android Developers. Discuss developing Android applications using the Android framework. Get help with troubleshooting apps, advice on implementation, ... ii ### http://www.freewebs.com/recordindstry/ ### --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] commons logging - android logging
I am trying to make commons-logging call the android.util.Log, therefor I have written a simple wrapper that implements the commons Log Interface. My problem is, that I allready have lots and lots of calls to org.apache.commons.logging.LogFacotry.getLog(). That method is static and I can influence its behaviour only(?) by a property file. But as I have read in lots of posts and issues on the bugtracker android has problems opening property Files on the classPath. Therefor I modified the org.apache.commons.logging.LogFactory (i deleted it from the jar, and put the source to my src folder). My change is rather simple: public static Log getLog(Class clazz) throws LogConfigurationException { return new AndroidLogWrapper(); } I built the project with success, but what I get still is: LogFactory.getLog(Whatever.class) instanceof Jdk14Logger instead of what i wanted: LogFactory.getLog(Whatever.class) instanceof AndroidLogWrapper I cleaned the bin directory, built again, same result. The only hind I have is what i get on LogCat which is: DexOpt: not resolving ambiguous class 'Lorg/apache/commons/logging/ LogFactory;' I havn't found any documentation of this message. So I am wondering, how could there be more than one LogFactory? I don't understand that. There is just the one LogFactory on my project. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] StartSubActivity in view
Hi all! I have a Activity with a view that it activates with the function setContentView(), i.e. the view class handles methods like onTouchEvent(), onKeyDown()... etc, and the necesary methods for move a objetct on the screen. Well, actually when the object arrives at determinate points on the screen (implemented with a rectangle) I want to start a new activity, i use: Intent intent = new Intent(contexto, PasoExperimento150.class); contexto.startActivity(intent); Where contexto is the context that i store in the constructor: public VistaPaso140(Context context, int imagen) { // contexto = context; } Now I want pass data between activities, but the method startActivityForResult is not disponible for context class. It is disponible only on activity class. How can I do this¿? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Help me to test APK file on your real device
I suppose you could also upload it to the marketplace under maybe the Demo category and name it TestMePlease :) On Sat, Nov 22, 2008 at 1:22 AM, Peter [EMAIL PROTECTED] wrote: Hi Ulziisaikhan, There's a (fairly) new service that enables developers to test their mobile application on a real device by a variety of different testers: http://www.testarmy.com/ If you can't obtain (or afford) a real Android device then this could be a cheap option. Regards, Peter On Oct 10, 8:44 pm, Ulzii [EMAIL PROTECTED] wrote: Hi All, I have finished an application for the Android platform device. I am writing from Ulaanbaatar, Mongolia. It means there is no possibility to test apk file on real android gPhone device. Is there anyone who obtained gPhone, could you help me to test my APK file on your device. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: how to inject a KeyEvent
Is that a permanent, security related, state if the droid, or is it thought that someday, with the right permissions, or between consenting applications, this would be allowed? :) On Fri, Nov 21, 2008 at 7:23 PM, Dianne Hackborn [EMAIL PROTECTED] wrote: Correct, one application can not inject key events into another application. There should be no way around this. For instrumentation test cases that cross application boundaries, I strongly recommend you set up an ActivityMonitor to block the launching of that other application's activity, returning a mocked result instead. On Fri, Nov 21, 2008 at 3:34 PM, dreamerBoy [EMAIL PROTECTED] wrote: Hi Hackbod - I tried this using Instrumentation - The goal of this little program is to make an outgoing call and then generate a keypress on the ENDCALL button. 1. It appears that I am incapable of unlocking the keyguard: 11-21 14:40:58.445: INFO/InstTest(209): after inKeyguardRestrictedInputMode() ? true 2. Then, Android tells me I don't have permission to send a key event: 11-21 14:41:00.173: WARN/WindowManager(53): Permission denied: injecting key event from pid 209 uid 10019 to window Window{43506808 com.android.phone/com.android.phone.InCallScreen} owned by uid 1001 EmptyActivity is just as it sounds - no additional code other than what Eclipse generates. If anyone can see something that is not being done correctly, I would very much appreciate their thoughts - Thanks - Paul ~~ package test.instTest; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.telephony.PhoneStateListener; import android.telephony.TelephonyManager; import android.test.ActivityInstrumentationTestCase; import android.util.Log; import android.view.KeyEvent; import android.app.Instrumentation; import android.view.View; import android.content.IntentFilter; import android.app.Instrumentation.ActivityResult; import android.app.KeyguardManager; public class InstTest extends ActivityInstrumentationTestCaseEmptyActivity { private static final String LOG_TAG= InstTest; private TelephonyManagertelMgr; private Instrumentation instrumentation; private Context context; private KeyguardManager keyguardMgr; public InstTest() { super(test.instTest, EmptyActivity.class); } public void testPreconditions() { instrumentation = getInstrumentation(); assertTrue(Instrumentation must be non-null, instrumentation ! = null); context = instrumentation.getContext(); assertTrue(Context must be non-null, context != null); telMgr = (TelephonyManager) context.getSystemService (Context.TELEPHONY_SERVICE); assertTrue(TelephonyManager must be non-null, telMgr != null); keyguardMgr = (KeyguardManager) context.getSystemService (Context.KEYGUARD_SERVICE); assertTrue(KeyguardManager must be non-null, keyguardMgr != null); } public void testCall() { testPreconditions(); Log.i(LOG_TAG, before inKeyguardRestrictedInputMode() ? + keyguardMgr.inKeyguardRestrictedInputMode()); KeyguardManager.KeyguardLock keyguardLock = keyguardMgr.newKeyguardLock(LOG_TAG); keyguardLock.disableKeyguard(); Log.i(LOG_TAG, after inKeyguardRestrictedInputMode() ? + keyguardMgr.inKeyguardRestrictedInputMode()); IntentFilter intentFilter = new IntentFilter (Intent.ACTION_CALL); Uri parsedPhoneNumber = Uri.parse(tel:1234567); Intent myIntent = new Intent(Intent.ACTION_CALL, parsedPhoneNumber); Intent resultData = new Intent(Intent.ACTION_CALL, parsedPhoneNumber); // myIntent = new Intent(Intent.ACTION_DIAL, parsedPhoneNumber); myIntent.setFlags(Intent.FLAG_DEBUG_LOG_RESOLUTION | Intent.FLAG_FROM_BACKGROUND | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); resultData.setFlags(Intent.FLAG_DEBUG_LOG_RESOLUTION | Intent.FLAG_FROM_BACKGROUND | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); Instrumentation.ActivityResult actResult = new Instrumentation.ActivityResult(Activity.RESULT_OK, resultData); Instrumentation.ActivityMonitor actMonitor = new Instrumentation.ActivityMonitor(intentFilter, actResult, false); Log.i(LOG_TAG, starting call.); instrumentation.waitForIdleSync(); context.startActivity(myIntent); instrumentation.waitForIdleSync(); Log.i(LOG_TAG, number of hits from ActivityMonitor: + actMonitor.getHits()); Activity phoneActivity = actMonitor.getLastActivity(); if (phoneActivity != null) Log.i(LOG_TAG, phoneActivity is NOT NULL!!); else Log.i(LOG_TAG, phoneActivity is NULL); Log.i(LOG_TAG, before phone state is + phoneStateToString()); Activity activity = getActivity(); Log.i(LOG_TAG, activity class is +
[android-developers] Re: get position of cursor in EditText
Thank you so much! That is indeed the way to do 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: StartSubActivity in view
have look here, maybe this is what you are looking for http://www.anddev.org/subactivites_with_return_value_-_the_inputbox-t99.html - Sunit Katkar http://sunitkatkar.blogspot.com/ - Android OS Tutorials On Sat, Nov 22, 2008 at 7:34 AM, Jose Alonso [EMAIL PROTECTED]wrote: Hi all! I have a Activity with a view that it activates with the function setContentView(), i.e. the view class handles methods like onTouchEvent(), onKeyDown()... etc, and the necesary methods for move a objetct on the screen. Well, actually when the object arrives at determinate points on the screen (implemented with a rectangle) I want to start a new activity, i use: Intent intent = new Intent(contexto, PasoExperimento150.class); contexto.startActivity(intent); Where contexto is the context that i store in the constructor: public VistaPaso140(Context context, int imagen) { // contexto = context; } Now I want pass data between activities, but the method startActivityForResult is not disponible for context class. It is disponible only on activity class. How can I do this¿? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Anyone able to get streetview working?
On Sep 30, 10:01 am, zl25drexel [EMAIL PROTECTED] wrote: Is anyone able to get streetview working? Yes, it took a little experimenting with the parameters. Here's a snippet, hope it helps - snip --- Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse (google.streetview:cbll= + (float)aGeoPoint.getLatitudeE6() / 100 + , + (float)aGeoPoint.getLongitudeE6() / 100 + cbp=1,180,,0,1.0)); startActivity(myIntent); - snip --- --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: missing javax audio?
The media framework code can be found in frameworks/base/media. The Packet Video OpenCore and Sonivox MIDI player are separate projects in external/opencoreand external/sonivox respectively. On Nov 22, 12:57 am, blindfold [EMAIL PROTECTED] wrote: Thank you Dianne. The media player application source is available; I was not aware of that as I (and I guess some others too) could not find it while browsing and searching throughhttp://android.git.kernel.org/ . Where exactly can we find it? Thanks. this discussion seems to be rooted on the view that google is the only one who can help us, when this is no longer the case and anyone can contribute. This was based on the (apparently wrong) assumption that the MediaPlayer source code is not available. Of course there can be a separate discussion on who should do the work. as David has said the things being asked for here are already well known limitations that effort is being put in to addressing. Excellent! By and large, all of the things being asked for aren't missing because they weren't deemed important, but simply because doing them is not trivial and will take significant effort to accomplish. I think we all understand and respect that. That is also why I think a deep understanding of the Android framework is needed to do this right. One can hardly expect that at this stage from third-party Android application developers who simply get stuck with the currently available audio functionality. As such, continual requests to have them added is not going to make that happen any faster. :) I understand. However, sharing some planning information on what is expected when would prevent those continual requests. Add some disclaimers where needed. Right now we only know that Google is aware of the problem and spending effort on it, but we do not have the slightest idea what priority it is given, when the next SDK will come out and when this particular audio problem is scheduled to be fixed. That is an invitation for sending regular reminders because we do not have the foggiest idea what is really going on and when we may expect results. Developers need to know that for their own application development planning, right? Anyway, don't let these discussions distract or discourage you from the real work. We are eagerly waiting for and will appreciate the solid results of your hard work. Regards On Nov 21, 11:21 pm, Dianne Hackborn [EMAIL PROTECTED] wrote: As far as I know, there is nothing related to any of the issues being discussed that is at this point closed source. The media player application source is available; the framework's implementation of MediaPlayer (this is part of the framework, not an application) is certainly all open sourced; and the low-level native PV libraries are all available as source. You can, today, go and download the android open-source project, and starting modifying PV and the framework to support streaming. That was all that I was trying to point out when saying people can submit patches: this discussion seems to be rooted on the view that google is the only one who can help us, when this is no longer the case and anyone can contribute. So if there is some specific feature you absolutely need, in some cases it may be a good use of time to just go and add it instead of asking for others to do so. That all said, I am not that familiar with the media stuff, but as David has said the things being asked for here are already well known limitations that effort is being put in to addressing. By and large, all of the thingsbeing asked for aren't missing because they weren't deemed important, but simply because doing them is not trivial and will take significant effort to accomplish. As such, continual requests to have them added is not going to make that happen any faster. :) -- Dianne Hackborn Android framework engineer [EMAIL PROTECTED] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Eclipse repo is down?
Same thing.. which kind of figures when you note that the beginning of that URL address is *dl-SSL*.. ;) And in all seriousness.. this isn't good considering this is the home of the Android SDK plugin for eclipse.. :| On Sat, Nov 22, 2008 at 8:19 AM, Dorn Hetzel [EMAIL PROTECTED] wrote: Try http instead of https On Sat, Nov 22, 2008 at 3:33 AM, Bogomil Shopov [EMAIL PROTECTED] wrote: Hi all, There is no Eclipse repo available here: https://dl-ssl.google.com/android/eclipse/ Bogo -- David Orriss Jr. My blog: http://www.codethought.com/blog --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] HttpClient and POST requests
Hi, I've a problem to translate follow code to org.apache.http.*; OutputStream pos = new OutputStream(); pos.writeShort(Const.INVOCATION_CODE); pos.writeInt(requestId); pos.writeString(nickname); pos.writeString(password); conn = (HttpConnection) Connector.open(url, Connector.READ_WRITE); conn.setRequestMethod(HttpConnection.POST); conn.setRequestProperty(Content-Type, application/octet- stream); conn.setRequestProperty(Accept, application/octet-stream); if(sessionCookie == null) { conn.setRequestProperty(version, ???); } else { conn.setRequestProperty(cookie, sessionCookie); } // Getting the output stream may flush the headers os = conn.openDataOutputStream(); os.write(pos.getBytes()); os.close(); start connection I must use : HttpClient conn = new DefaultHttpClient(); HttpPost httppost = new HttpPost(url); but I've difficult to understand what must I use to set the request proprieties (setRequestProperty) and use an OutputStream to send my requests 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: map view problem
It is normally something to do with permissions especially INTERNET position and COARSE_LOCATION. They also have to be in the correct location above application statemeny I believe On 21 Nov 2008, 5:41 PM, Boris Malenšek [EMAIL PROTECTED] wrote: I have the same problem but can not solve it. My background should be Map but it is some kind of white-gray stupid picture. In left-bottom corner is Google sign, so it means that shomhow it works but not well. I have double-checked my apiKey for registering my application and it is correct. Any1? On Oct 29, 12:49 pm, sami [EMAIL PROTECTED] wrote: Hi , I got mapview 3days before ,but from yesterday i am getting grid instead of mapview.i got solution from our goups also but its still not working .please help me.DATA_Preferences,DATA_Tileswas not created automatically .i pushed those files manually also.please help me .i am struggling ... --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] What part do I have to focus when I develope?
Hi. I'm developing an android application which uses character recognition techonology. I'm currently eager to join to the android 2nd competition with my colleagues, and we have worked at 3 months on it. The application we making includeds a fucntion of character recognition but the recognition ratio is too low. There's so many constraint conditions to recognize characters as it is. The application we found can reconize only a few of fonts in english. Even the background should be clean and white, and It persists only a few of fonts style in english. I'm looking for a nice-working character recongition library for free to use in this program but it's not so easy. Here's the Question: 1. Should we focus on to make the level of our own project be more perfect exclude character recognition or 2. Should we try to make it to be a well-recognized application for any characters? We're concerning of the android competition. 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Help me to test APK file on your real device
Hi! I have a similar question. f it's possible to upload apk directly from comp to device? Thanks On Sat, Nov 22, 2008 at 6:23 PM, Dorn Hetzel [EMAIL PROTECTED] wrote: I suppose you could also upload it to the marketplace under maybe the Demo category and name it TestMePlease :) On Sat, Nov 22, 2008 at 1:22 AM, Peter [EMAIL PROTECTED] wrote: Hi Ulziisaikhan, There's a (fairly) new service that enables developers to test their mobile application on a real device by a variety of different testers: http://www.testarmy.com/ If you can't obtain (or afford) a real Android device then this could be a cheap option. Regards, Peter On Oct 10, 8:44 pm, Ulzii [EMAIL PROTECTED] wrote: Hi All, I have finished an application for the Android platform device. I am writing from Ulaanbaatar, Mongolia. It means there is no possibility to test apk file on real android gPhone device. Is there anyone who obtained gPhone, could you help me to test my APK file on your device. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] about open source project
Hello guys: I have used Android in Ubuntu 8.04 recently and it can work now. Besides, I also make the source code in here http://source.android.com/projects and instruction of repo sync and make have cost me lots of time. And now my question is, how should I use these source code? Run in eclipse to show in emulator or whatelse? Thank you for your response. Samuel --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Help me to test APK file on your real device
Hi! I have a similar question. f it's possible to upload apk directly from comp to device? Thanks On Nov 22, 6:23 pm, Dorn Hetzel [EMAIL PROTECTED] wrote: I suppose you could also upload it to the marketplace under maybe the Demo category and name it TestMePlease :) On Sat, Nov 22, 2008 at 1:22 AM, Peter [EMAIL PROTECTED] wrote: Hi Ulziisaikhan, There's a (fairly) new service that enables developers to test their mobile application on a real device by a variety of different testers: http://www.testarmy.com/ If you can't obtain (or afford) a real Android device then this could be a cheap option. Regards, Peter On Oct 10, 8:44 pm, Ulzii [EMAIL PROTECTED] wrote: Hi All, I have finished an application for the Android platform device. I am writing from Ulaanbaatar, Mongolia. It means there is no possibility to test apk file on real android gPhone device. Is there anyone who obtained gPhone, could you help me to test my APK file on your device.- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: G1 linux
Hi Jim: Is it possible to run Openmoko SO on other hardware than Freerunner? (thinking on iPaq hx 4700). Same question would apply to Android. I think it's time to re-use old machines: better for Nature and our poor economy (i do no not care about big companies: they do care about themselves). Thx On 22 nov, 16:05, Jim Ancona [EMAIL PROTECTED] wrote: If you're not wedded to the G1, you might consider the Openmoko Freerunner (http://wiki.openmoko.org/wiki/Neo_FreeRunner), which has Bluetooth, Wifi and GPS and runs several Linux distributions, as well as Android. Jim On Nov 21, 3:56 pm, clark [EMAIL PROTECTED] wrote: True, but if his phone has upgraded to RC30 yet, then he could get root access and install debian alongside android which is detailed herehttp://www.saurik.com/id/10. Another possibility would be to hope that Android is upgraded to allow access to the bluetooth hardware through the SDK. Then you could right a little java app to get the job done. On Nov 18, 3:07 pm, Diego Torres Milano [EMAIL PROTECTED] wrote: On Nov 18, 11:51 pm, Rui Freitas [EMAIL PROTECTED] wrote: Hi, I wanna now if is it possible to program for the G1 like a linux device. If so, how can i do it? Where can i find that kind of information? Android is based on a Linux kernel but strictly speaking it's not Linux. Android has no native windowing system, no glibc support and doesn't include all of the libraries and utilities usually available in a Linux system. Thanks, Rui- Hide quoted text - - Show quoted text -- Ocultar texto de la cita - - Mostrar texto de la cita - --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Help me to test APK file on your real device
EvgenyV wrote: Hi! I have a similar question. f it's possible to upload apk directly from comp to device? With the SDK, you install an APK on the device the same way you install the APK on the emulator, so long as the device is plugged into the PC via the USB cable: http://code.google.com/android/intro/develop-and-debug.html -- Mark Murphy (a Commons Guy) http://commonsware.com Android Training on the Ranch! -- Mar 16-20, 2009 http://www.bignerdranch.com/schedule.shtml --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Multipart Messages - Is there an example how to get them work now. (Uploading to a web API)
@Joe LaPenna I am trying to send multipart to google appengine as well and struggling. Do you have any specific instructions that might help? On Oct 12, 12:56 am, Joe LaPenna [EMAIL PROTECTED] wrote: By chance is the web server google app engine? Even if it isn't there is a chance your server does not support chunked transfer encoding. If for example any part of your multipart message is an inputstream part then the library will set the post using chunked encoding. I got around this in gae creating my own inputstream. Part that supported getcontentlenght and the other method that specified that reading the stream did not consume it. (I returned a copy of the stream when it is requesrted). Sorry if this is a bit vague, I'm away from the code I wrote at the moment. On Oct 7, 2008 8:52 PM, Vinod B [EMAIL PROTECTED] wrote: hi, I am sending an http post of a multipart (form-data) as shown below to an apache web server. It returns an error saying the Content-length header needs to be specified. Looking at the trace, the Content-Length header is indeed not being set in the request. I tried getting the content length using requestContent.getContentLength () only to get -1. So any pointers on what to do for this problem? thanks, -Vinod On Aug 19, 4:18 pm, Justin (Google Employee) [EMAIL PROTECTED] wrote: Just to finish this thread off nicely, here's some code to usemultipartposts. Again, you need mime4j, httpmime, and Apache Commons IO. import java.io.ByteArrayInputStream; import java.io.InputStream; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.mime.MultipartEntity; import org.apache.http.entity.mime.content.ContentBody; import org.apache.http.entity.mime.content.InputStreamBody; import org.apache.http.entity.mime.content.StringBody; import org.apache.http.impl.client.DefaultHttpClient; ... HttpClient httpClient = new DefaultHttpClient(); HttpPost request = new HttpPost(http://www.example.com;); // we assume 'data' is some byte array representing a jpeg InputStream ins = new ByteArrayInputStream(data); parts[0] = new InputStreamBody(ins, image.jpg); parts[1] = new StringBody(some bit of information); parts[2] = new StringBody(another bit of information); // create themultipartrequest and add the parts to it MultipartEntity requestContent = new MultipartEntity(); requestContent.addPart(image.jpg, parts[0]); requestContent.addPart(data_part1, parts[1]); requestContent.addPart(data_part2, parts[2]); // execute the request request.setEntity(requestContent); httpClient.execute(request); The HttpClient execute method will give you a handle to the response. From that you can do HttpResponse.getEntity().getContent() which will give you an InputStream to read the response. Unfortunately the InputStream doesn't produce a meaningful response for InputStream.available(). This might be because somewhere along the way the Content-Length header seems to be getting lost, but I haven't had time to look into this further yet. Cheers, Justin Android Team @ Google On Aug 18, 11:13 pm, code_android_festival_way [EMAIL PROTECTED] wrote: Thank you Justin for helping me out. It is working pretty fine now. :-) Cheers from Germany! On 19 Aug., 02:11, Justin (Google Employee) [EMAIL PROTECTED] wrote: Looks like you also need the Apache Commons IO library which you can get fromhttp://commons.apache.org/io/. Cheers, Justin Android Team @ Google On Aug 18, 3:19 pm, code_android_festival_way [EMAIL PROTECTED] wrote: So I'm back with a question. I've imported the libraries mentioned above and got the following setup: http://paste.pocoo.org/show/82631/ Now I get an error while executing the POST method with the HttpClient. Am I doing sth. wrong or what do I have to change to get it working. (the paste above is cutted down to the most important parts) The error message: Error in org.apache.commons.io.ouput.ByteArrayOutputStream I'm looking forward getting some answers. Regards! On 18 Aug., 22:35, code_android_festival_way [EMAIL PROTECTED] wrote: Thank you for your answer Dan. I'm looking now how to get the whole thing working. (since I'm not the best Java developer :) ) I will come back with the results later on. On 18 Aug., 22:26, Dan Morrill [EMAIL PROTECTED] wrote: To shed a bit more light, the reason the multi-part APIs were removed is because those APIs will not be final in the upstream Apache HTTPClient in time for Android's schedule for a final 1.0 version. Rather than ship an early/incompatible API, we chose to remove it, and rely on other libraries as Justin suggested. Note that this applies only to the multi-part APIs: the rest of the Apache
[android-developers] Camera Question: Off on Pause?
Here is what my app does: It opens the camera. It draws a preview to a surface. Now, if the user pauses the app, is the camera still siphoning the battery? How can I make sure it is off? Thanks Josh Beck http://globedroid.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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Camera Question: Off on Pause?
Call the release() method on the Camera object and set it to null. In onResume, create a new Camera object. On Nov 22, 1:23 pm, joshbeck [EMAIL PROTECTED] wrote: Here is what my app does: It opens the camera. It draws a preview to a surface. Now, if the user pauses the app, is the camera still siphoning the battery? How can I make sure it is off? Thanks Josh Beckhttp://globedroid.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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] How to Display Captured Camera Frame
I am trying to capture a picture from the Android camera - preferrably raw, but jpg ok - and then display it on the G1 screen. My problem is that only black frames are displayed. The preview does work. This code works on the emulator, but displays a black frame on the G1 device. The emulator displays an interesting picture of the green android robot and a blackberry like phone. Here is the code I am using. I have tried many options for the Camera parameters including various PixelFormats and resolutions. In addition to the code below, I have tried various versions with BitmapDisplayables and ByteArrayInputStreams. Here is the code I am currently using to attempt to display the image: Camera.PictureCallback pictureCallback = new Camera.PictureCallback() { public void onPictureTaken(byte[] data, Camera camera) { Bitmap bm = BitmapFactory.decodeByteArray(data, 0, data.length); ImageView iv = new ImageView(cx); iv.setImageBitmap(bm); linearLayout.addView(iv); } }; Does anyone have any idea why this code is not working Thank you for any help you can offer. - Sincerely, David Manpearl --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] TabHost and New Activities
Hello, I've been trying to start new activities based on a TabHost using the following code: setContentView(R.layout.main); TabHost tabs = (TabHost)this.findViewById(R.id.th_set_menu_tabhost); tabs.setup(); TabSpec ts1 = tabs.newTabSpec(Page 1); ts1.setIndicator(p1); ts1.setContent(R.id.Main); tabs.addTab(ts1); TabSpec ts2 = tabs.newTabSpec(Page 2); ts2.setIndicator(p2); ts2.setContent(new Intent(this, NewActivity.class)); tabs.addTab(ts2); But I keep getting the following error: 11-22 14:55:43.913: ERROR/AndroidRuntime(1231): java.lang.IllegalStateException: Did you forget to call 'public void setup(LocalActivityManager activityGroup)'? 11-22 14:55:43.913: ERROR/AndroidRuntime(1231): at android.widget.TabHost$IntentContentStrategy.getContentView (TabHost.java:598) 11-22 14:55:43.913: ERROR/AndroidRuntime(1231): at android.widget.TabHost.setCurrentTab(TabHost.java:310) 11-22 14:55:43.913: ERROR/AndroidRuntime(1231): at android.widget.TabHost$2.onTabSelectionChanged(TabHost.java:126) Any ideas on this? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Eclipse repo is down?
I wonder if Bogomil tried this in Eclipse or just in a browser? While you get a 404 from the browser the link works without a hitch in Eclipse... On Sat, Nov 22, 2008 at 1:31 PM, Dorn Hetzel [EMAIL PROTECTED] wrote: Well, I can tell you that a few days ago, https didn't work for me, and http still whined, but when I expanded the selection box, what I needed was magically there. On Sat, Nov 22, 2008 at 2:08 PM, David Orriss Jr [EMAIL PROTECTED] wrote: Same thing.. which kind of figures when you note that the beginning of that URL address is *dl-SSL*.. ;) And in all seriousness.. this isn't good considering this is the home of the Android SDK plugin for eclipse.. :| On Sat, Nov 22, 2008 at 8:19 AM, Dorn Hetzel [EMAIL PROTECTED] wrote: Try http instead of https On Sat, Nov 22, 2008 at 3:33 AM, Bogomil Shopov [EMAIL PROTECTED] wrote: Hi all, There is no Eclipse repo available here: https://dl-ssl.google.com/android/eclipse/ Bogo -- David Orriss Jr. My blog: http://www.codethought.com/blog -- David Orriss Jr. My blog: http://www.codethought.com/blog --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: TabHost and New Activities
g1bb wrote: I've been trying to start new activities based on a TabHost using the following code: setContentView(R.layout.main); TabHost tabs = (TabHost)this.findViewById(R.id.th_set_menu_tabhost); tabs.setup(); TabSpec ts1 = tabs.newTabSpec(Page 1); ts1.setIndicator(p1); ts1.setContent(R.id.Main); tabs.addTab(ts1); TabSpec ts2 = tabs.newTabSpec(Page 2); ts2.setIndicator(p2); ts2.setContent(new Intent(this, NewActivity.class)); tabs.addTab(ts2); But I keep getting the following error: 11-22 14:55:43.913: ERROR/AndroidRuntime(1231): java.lang.IllegalStateException: 11-22 14:55:43.913: ERROR/AndroidRuntime(1231): at android.widget.TabHost$IntentContentStrategy.getContentView (TabHost.java:598) 11-22 14:55:43.913: ERROR/AndroidRuntime(1231): at android.widget.TabHost.setCurrentTab(TabHost.java:310) 11-22 14:55:43.913: ERROR/AndroidRuntime(1231): at android.widget.TabHost$2.onTabSelectionChanged(TabHost.java:126) Any ideas on this? Thanks in advance! The error message may be accurate: Did you forget to call 'public void setup(LocalActivityManager activityGroup)'? That's a method on TabHost -- you need to call it before adding tabs if your Activity is not a subclass of TabActivity. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.4 Published! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: missing javax audio?
Alright, well the gist of this is pretty clear. I'm no champion of the javax.sound API in particular, but I was happy to move my project from a MIDP target to Android, especially since the emulation and on-loading tools were much more sophisticated and open. I moved *because* the functionality I needed was there at the time. My requirements are pretty simple: 1) record to a file 2) open that file with some sort of input stream 3) read chunks from that stream and get amplitude info and whatnot from each sample 4) not have to worry about the particulars of the audio codecs and algorithms of the stored files The AudioInputStream etc. let me do that. Now I'm looking at having to send the audio snippet off-phone for the processing and then send the results back. Obviously that may not be scalable at all, but might be an interim solution until something is more supported. I appreciate the so help and send patches! request, and I'm glad the codebase is open. However, for a product which is being sold on a production device, it smacks as a cheap way to get free coders for a REALLY BIG company. Regardless, I'm glad it's an option, and frankly it's one of the reasons I'm trying to work with the platform in the first (maybe second) place. Thanks for the info. -Ethan On Nov 21, 9:07 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: There is no approved method for getting at sample audio input or output in SDK 1.0. We are aware that is a significant limitation and efforts are underway to address it. On Nov 21, 11:06 am, Sriramv [EMAIL PROTECTED] wrote: What about the SoniVox audio APIs? SoniVox (http://www.sonivoxrocks.com/google.html) is already in the source tree under external libraries. Can they be used to access sample-level audio streams at the moment? On Nov 20, 8:29 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: We are committed to improved multimedia support, as I've made clear in other posts. You'll see some new features in the next major SDK release. We just don't think that javax is the best way to support audio. On Nov 20, 12:36 pm, blindfold [EMAIL PROTECTED] wrote: Fair enough. Sorry (also to Ethan) for perhaps distracting a bit from javax.soundeven though Java ME supports much the samejavax.sound AudioInputStream functionality that Ethan was specifically inquiring about. Glad to hear that our ideas match. It should help in getting the actual work done. Thanks On Nov 20, 9:23 pm, Dan Bornstein [EMAIL PROTECTED] wrote: The original request was (and the subject line still is) specifically about functionality injavax.sound. I responded in that context. My later remarks were meant to frame the larger picture. Briefly put, we agree. -dan --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Camera Question: Off on Pause?
Question: By calling Camera.stopPreview(); It should also free up the Camera device, right. It's the preview that's drawing power I think. (Anyway, when I handle things that way, I am able to use other Camera apps while mine is pausede, which leads me to believe stopping the preview will conserve battery life.) ? Thanks again, Josh On Nov 22, 3:30 pm, Dave Sparks [EMAIL PROTECTED] wrote: Call the release() method on the Camera object and set it to null. In onResume, create a new Camera object. On Nov 22, 1:23 pm, joshbeck [EMAIL PROTECTED] wrote: Here is what my app does: It opens the camera. It draws a preview to a surface. Now, if the user pauses the app, is the camera still siphoning the battery? How can I make sure it is off? Thanks Josh Beckhttp://globedroid.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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Java IO is super-slow in Android -- why?
Unfortunately that doesn't explain the speed problem. The processor is almost 600MHz, that means it's taking 2400 CPU cycles *per byte* on the read operation. An unbelievable overhead. Also I get 5MB/s both up and down when connecting over USB, so the O/S (which is admittedly running native code, not Dalvik bytecodes) can go much, much faster than that, and it's not that the speed of flash memory is the bottleneck either. The overhead of Dalvik is not *that* high, so something else is going on that is making this about an order of magnitude slower than it should be. Does anyone else have any ideas? On Nov 22, 9:55 am, Sunit Katkar [EMAIL PROTECTED] wrote: Phones in general do not have super fast CPUs like laptop and desktops. Android runs on a phone CPU which is not very fast. Overall you will see that programs dont necessarily run at the same speed as on a laptop. - Sunit Katkarhttp://sunitkatkar.blogspot.com/- Android OS Tutorials On Fri, Nov 21, 2008 at 8:08 PM, __ [EMAIL PROTECTED] wrote: I measure the speed of copying files to/from the SD card at about 5MB/ sec on my G1, however the following speed test tops out at about 250kB/ sec read and 125kB/sec write. (The example shown writes to the internal SD card, but writing to the removable card is about the same speed.) Why is it so slow? (Using NIO channels to write whole arrays of bytes doesn't speed it up by much...) -- long startTime = System.currentTimeMillis(); BufferedOutputStream writer = new BufferedOutputStream(openFileOutput (speedtest, MODE_PRIVATE)); int size = 100; for (int i = 0; i size; i++) writer.write((byte) 0); writer.close(); Log.i(speedtest, speed test a: + (System.currentTimeMillis() - startTime)); startTime = System.currentTimeMillis(); BufferedInputStream in = new BufferedInputStream(openFileInput (speedtest)); for (int i = 0; i size; i++) in.read(); in.close(); Log.i(speedtest, speed test b: + (System.currentTimeMillis() - startTime)); startTime = System.currentTimeMillis(); --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Import Typeface from another apk?
Wow! Great! It works :-) Follow-up questions: 1) Is it possible to restrict other applications to access one's assets files? 2) getAssets().list() seems to list three directories by default: images, sounds, and webkit. Is there some reason behind this, or did some assets leak here that should not be here? (the images directory contains for example boot_robot.png and boot_robot_glow.png) Thanks, Peli On 22 Nov., 01:24, Dianne Hackborn [EMAIL PROTECTED] wrote: You can just create a context for the other application, and get its resources and then asset manager and use that. On Fri, Nov 21, 2008 at 3:07 PM, Peli [EMAIL PROTECTED] wrote: Is it possible to import a Typeface from another apk? Or from the SD card? I only found: Typeface.createFromAsset(AssetManager mgr, String path) http://code.google.com/android/reference/android/graphics/Typeface.html I would like to ship fonts as an add-on to the main application, since font files can be large. For this reason, the main application would have to access a font from a different location than its own asset folder. I thought about maybe overriding AssetManager to provide a custom InputStream for the font data, but this is not possible because AssetManager is declared as final. Are there any other tricks I could use to obtain Typeface from a different location? Peli -- Dianne Hackborn Android framework engineer [EMAIL PROTECTED] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Java IO is super-slow in Android -- why?
Your code is extremely inefficient; stick to the stream read/write methods that use byte buffers: they are much faster because they avoid the cost of a method call for each byte. And if you use those methods exclusively, dropping the BufferedInput/OutputStream is almost certain to give better performance. Modifying your code to use an 8KB buffer I got this output from your code: BEFORE: speed test a: 8361ms speed test b: 2405ms AFTER: speed test a: 123ms speed test b: 2ms Tom. 2008/11/22 __ [EMAIL PROTECTED] Unfortunately that doesn't explain the speed problem. The processor is almost 600MHz, that means it's taking 2400 CPU cycles *per byte* on the read operation. An unbelievable overhead. Also I get 5MB/s both up and down when connecting over USB, so the O/S (which is admittedly running native code, not Dalvik bytecodes) can go much, much faster than that, and it's not that the speed of flash memory is the bottleneck either. The overhead of Dalvik is not *that* high, so something else is going on that is making this about an order of magnitude slower than it should be. Does anyone else have any ideas? On Nov 22, 9:55 am, Sunit Katkar [EMAIL PROTECTED] wrote: Phones in general do not have super fast CPUs like laptop and desktops. Android runs on a phone CPU which is not very fast. Overall you will see that programs dont necessarily run at the same speed as on a laptop. - Sunit Katkarhttp://sunitkatkar.blogspot.com/- Android OS Tutorials On Fri, Nov 21, 2008 at 8:08 PM, __ [EMAIL PROTECTED] wrote: I measure the speed of copying files to/from the SD card at about 5MB/ sec on my G1, however the following speed test tops out at about 250kB/ sec read and 125kB/sec write. (The example shown writes to the internal SD card, but writing to the removable card is about the same speed.) Why is it so slow? (Using NIO channels to write whole arrays of bytes doesn't speed it up by much...) -- long startTime = System.currentTimeMillis(); BufferedOutputStream writer = new BufferedOutputStream(openFileOutput (speedtest, MODE_PRIVATE)); int size = 100; for (int i = 0; i size; i++) writer.write((byte) 0); writer.close(); Log.i(speedtest, speed test a: + (System.currentTimeMillis() - startTime)); startTime = System.currentTimeMillis(); BufferedInputStream in = new BufferedInputStream(openFileInput (speedtest)); for (int i = 0; i size; i++) in.read(); in.close(); Log.i(speedtest, speed test b: + (System.currentTimeMillis() - startTime)); startTime = System.currentTimeMillis(); --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: TabHost and New Activities
Gotcha, but how do I define activityGroup as a LocalActivityManager? (I assume that's what it's wanting) Sorry, I can't find much documentation on this. Thanks again. On Nov 22, 3:20 pm, Mark Murphy [EMAIL PROTECTED] wrote: g1bb wrote: I've been trying to start new activities based on a TabHost using the following code: setContentView(R.layout.main); TabHost tabs = (TabHost)this.findViewById(R.id.th_set_menu_tabhost); tabs.setup(); TabSpec ts1 = tabs.newTabSpec(Page 1); ts1.setIndicator(p1); ts1.setContent(R.id.Main); tabs.addTab(ts1); TabSpec ts2 = tabs.newTabSpec(Page 2); ts2.setIndicator(p2); ts2.setContent(new Intent(this, NewActivity.class)); tabs.addTab(ts2); But I keep getting the following error: 11-22 14:55:43.913: ERROR/AndroidRuntime(1231): java.lang.IllegalStateException: 11-22 14:55:43.913: ERROR/AndroidRuntime(1231): at android.widget.TabHost$IntentContentStrategy.getContentView (TabHost.java:598) 11-22 14:55:43.913: ERROR/AndroidRuntime(1231): at android.widget.TabHost.setCurrentTab(TabHost.java:310) 11-22 14:55:43.913: ERROR/AndroidRuntime(1231): at android.widget.TabHost$2.onTabSelectionChanged(TabHost.java:126) Any ideas on this? Thanks in advance! The error message may be accurate: Did you forget to call 'public void setup(LocalActivityManager activityGroup)'? That's a method on TabHost -- you need to call it before adding tabs if your Activity is not a subclass of TabActivity. -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.4 Published! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Help!!the fonts width and height???Thanks!
Somebody know On Nov 22, 10:44 pm, SinFrancis [EMAIL PROTECTED] wrote: I have a TextView, if i want calculate how many characters in a line, must be get the textview width and the char width, then calculate the result ! Now i how the width, don't know a char width! Some one can help me??? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: TabHost and New Activities
g1bb wrote: Gotcha, but how do I define activityGroup as a LocalActivityManager? (I assume that's what it's wanting) If you're not subclassing TabActivity, can you? If the docs are right, that should clear up your problem. Since TabActivity inherits from ActivityGroup, my guess is that the docs are probably correct -- if you inherit from TabActivity, it might just work. If you feel you can't subclass TabActivity for some reason, maybe we can work to fix that problem -- what is holding you back? If you're adamant about not subclassing TabActivity, I'm not sure how you'd make this work, though that doesn't mean it can't be done. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.4 Published! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Unique identifier of an instance (port number)
Hi all, I'm trying to get network information using some piece of code like this: ConnectivityManager cm = ConnectivityManager)mActivity.getSystemService (mActivity.CONNECTIVITY_SERVICE); NetworkInfo netinfo = cm.getActiveNetworkInfo(); But, as reported here, http://groups.google.com/group/android-developers/browse_thread/thread/b013d51d1fa52b25/508adcb5281bb778?lnk=gstq=networkinfo#508adcb5281bb778 I'm not able to get the information I need. Actually, what I need is the port number or any other unique identifier to distinguish between different instances of the emulator. Is there another way to do it instead of using the ConnectivityManager/ NetworkInfo? Thanks a lot for any 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Problem doing the programming tutorial
Hello, I downloaded and set up the sdk and I was working on the Hello, Android! part of the tutorial, but I am having issues. When I ran the code nothing happens expect that a android simulator pops up in my screen. The doesn't seem to do anything and it doesn't look anything like what it should in the Hello, Android! tutorial. I tried this answer codes provided in the tutorial for the Hello, Android! and the notepad application and the same simulator appears. Can any1 tell me how to fix this and what i'm doing wrong. Also i'm using eclipse to work on the programs. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Drawing lines in the whole EditText view
hi, i was reviewing the notepad application available bundled as a sample application in the sdk and in the customized EditText i was trying to achieve drawing lines on the whole screen by replacing the following code snippet: @Override protected void onDraw(Canvas canvas) { int count = getLineCount(); Rect r = mRect; Paint paint = mPaint; for (int i = 0; i getLineCount(); i++) { int baseline = getLineBounds(i, r); canvas.drawLine(r.left, baseline + 1, r.right, baseline + 1, paint); } super.onDraw(canvas); } with this: @Override protected void onDraw(Canvas canvas) { int count = getLineCount(); Rect r = mRect; Paint paint = mPaint; int lineBounds = 23; int singleLineBounds = 21; for (int i = 0; i 5; i++) { int baseline = lineBounds; canvas.drawLine(r.left, baseline + 1, r.right, baseline + 1, paint); lineBounds += singleLineBounds; } super.onDraw(canvas); } The first code snippet would print the line if there was actually data in those lines and what im trying to do is to print those lines in the whole EditText view no matter how many lines we have and it seems not to be working at all, is there any work around for this ? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Server and ServerSockets
Hi, I'm would like to connect to android phones with raw sockets but i can't get it to work. I use the following simple code... [android activity server] package org.androidapp.threadserver; import java.io.IOException; import java.net.*; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class Server extends Activity { /** Called when the activity is first created. */ TextView tv; ServerSocket ss; Socket s; int port = 2; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); tv = (TextView) findViewById(R.id.info); Thread thread = new Thread(new Runnable() { public void run() { try { ss = new ServerSocket(port); tv.setText(Server listening on port + port +...\n); s = ss.accept(); tv.append(Connection established!\n); // TODO Server-side logic ss.close(); s.close(); tv.append(Connection closed.); } catch (IOException e) { // TODO Auto-generated catch block tv.setText(e.toString()); } } }); thread.start(); } } [android activity client] package org.androidapp.threadclient; import java.io.IOException; import java.net.*; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class Client extends Activity { /** Called when the activity is first created. */ TextView tv; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); tv = (TextView)findViewById(R.id.info); } public void onStart(){ super.onStart(); Thread thread = new Thread(new Runnable() { public void run() { try { Socket s = new Socket(10.0.2.2,1); s.getKeepAlive(); tv.setText(Connection established!\n); // TODO Client-side logic s.close(); tv.append(Connection closed.\n); } catch (IOException e) { // TODO Auto-generated catch block tv.setText(e.toString()); } } }); thread.start(); } } I always get the server activity to stop unexpectedly. what am i doing wrong? could anyone show me some simple android code for establishing a tcp socket connection between two android's? Thank you for the help. Gonzalo. pd. i do add tcp redirection (redir add tcp:1:2). the client seems to connect but that make the server stop unexpectedly. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Drawing lines in the whole EditText view
hi, i was reviewing the notepad application available bundled as a sample application in the sdk and in the customized EditText i was trying to achieve drawing lines on the whole screen by replacing the following code snippet: @Override protected void onDraw(Canvas canvas) { int count = getLineCount(); Rect r = mRect; Paint paint = mPaint; for (int i = 0; i getLineCount(); i++) { int baseline = getLineBounds(i, r); canvas.drawLine(r.left, baseline + 1, r.right, baseline + 1, paint); } super.onDraw(canvas); } with this: @Override protected void onDraw(Canvas canvas) { int count = getLineCount(); Rect r = mRect; Paint paint = mPaint; int lineBounds = 23; int singleLineBounds = 21; for (int i = 0; i 5; i++) { int baseline = lineBounds; canvas.drawLine(r.left, baseline + 1, r.right, baseline + 1, paint); lineBounds += singleLineBounds; } super.onDraw(canvas); } The first code snippet would print the line if there was actually data in those lines and what im trying to do is to print those lines in the whole EditText view no matter how many lines we have and it seems not to be working at all, is there any work around for this ? 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Testing on Android device - question.
Do you mean to load your own programs onto your phone for testing? Use the android SDK (the adb tool in particular) to do that. On Nov 22, 9:49 am, EvgenyV [EMAIL PROTECTED] wrote: All, If it's possible to downolad the application to G-1 for tests even if it still not released and not supported by cell companies? Thanks in advance, Evgeny --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Problem doing the programming tutorial
When the android emulator pops up it takes a good while to boot b4 it runs your code On Nov 22, 2008 8:13 PM, automerc [EMAIL PROTECTED] wrote: Hello, I downloaded and set up the sdk and I was working on the Hello, Android! part of the tutorial, but I am having issues. When I ran the code nothing happens expect that a android simulator pops up in my screen. The doesn't seem to do anything and it doesn't look anything like what it should in the Hello, Android! tutorial. I tried this answer codes provided in the tutorial for the Hello, Android! and the notepad application and the same simulator appears. Can any1 tell me how to fix this and what i'm doing wrong. Also i'm using eclipse to work on the programs. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] how can i reboot the device or lock the device using sdk?
Hi Guys, Please help me to solve the problem listed as below: how can i reboot the device or lock the device using sdk? Many thanks, Forrest --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: how can i reboot the device or lock the device using sdk?
I used Runtime run = Runtime.getRuntime(); run.exec(reboot); to reboot the device. but i am failed. On 11月22日, 下午11时03分, forrestxu [EMAIL PROTECTED] wrote: Hi Guys, Please help me to solve the problem listed as below: how can i reboot the device or lock the device using sdk? Many thanks, Forrest --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Problem doing the programming tutorial
android emulator can take upto 5 minutes or more on certain machines.. - Sunit Katkar http://sunitkatkar.blogspot.com/ - Android OS Tutorials On Sat, Nov 22, 2008 at 1:17 PM, automerc [EMAIL PROTECTED] wrote: Hello, I downloaded and set up the sdk and I was working on the Hello, Android! part of the tutorial, but I am having issues. When I ran the code nothing happens expect that a android simulator pops up in my screen. The doesn't seem to do anything and it doesn't look anything like what it should in the Hello, Android! tutorial. I tried this answer codes provided in the tutorial for the Hello, Android! and the notepad application and the same simulator appears. Can any1 tell me how to fix this and what i'm doing wrong. Also i'm using eclipse to work on the programs. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Custom background for selected Listview Items
U need to extend the BaseAdapter...in the getView of the Adapter.. u need to set a diff backgrnd ..as per ur requirement.. On Sat, Nov 22, 2008 at 11:09 AM, AusSeattle [EMAIL PROTECTED] wrote: Hi, I am having a problem I just could not figure out how to solve. I am showing a list of items - some of them active and some of them inactive. I would like to change the background color for the listview items which are not active. Does anybody know how to do that? Thank you for your response --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: another new return of findViewById???
the activity gets destroyed and again gets restarted..thats the reason.. On Wed, Nov 19, 2008 at 2:18 PM, Gameboy [EMAIL PROTECTED] wrote: I want to change content of edit text after changing orientaton, but seems I get strange problem: I use mEditor = (EditText) findViewById(R.id.editor); in onCreate(), when changing orientation, onCreate() will be invoked again, however seems mEditor becomes new one after changing orientaton each time, mEditor is not the same original instance before changing orientation, who can tell me why and how can I get the original one? I found another trick way but still look forward reason or better path. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] How do i detect the click of home button?
I want to know how do i detect the click of home button.. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---