[android-developers] Re: Test Location Providers in 1.0
The test-location-provider-thing was unnecessary form the start. You have to do just one thing: implement a service that continiously updates you current location. Thats all. On 24 Sep., 11:21, Guillaume Perrot <[EMAIL PROTECTED]> wrote: > I was wondering too, I had to disable this function from my > application... > It seems we can only use DDMS or telnet to simulate location now. > > On 24 sep, 08:34, Reto Meier <[EMAIL PROTECTED]> wrote: > > > The ability to create and configure mock location providers that was > > added in Beta 0.9 doesn't seem available in 1.0. > > > Has this functionality been moved / renamed or has it been dropped > > entirely for version 1? If the latter, how do we now mock the status > > and availability of Location Providers? > > > Cheers > > Reto --~--~-~--~~~---~--~~ 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] ContentHandler.startElement(..) and ContentHandler.endElement(..) won't be called in 1.0 rc1
Following scenario: SAXParser saxParser = saxParserFactory.newSAXParser(); XMLReader xmlReader = saxParser.getXMLReader(); xmlReader.setContentHandler(handler); xmlReader.parse(someImputStream); where handler implements ContentHandler. xmlReader.parse(..) calls handler.characters(..) but neither handler.startElement(..) nor handler.endElement(..). This worked well in 0.9. Can this regression be reproduced by anybody? --~--~-~--~~~---~--~~ 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] openjdk is not okay?
openjdk != gcj. I am also using openjdk and haven't experienced any problems so far. > am planning to setup the android-sdk @ ubuntu8041 > i have opensdk6 installed > does this have to be the one from sun? > your install guid is saying that > ant is not compatible with gcj ... no? > --~--~-~--~~~---~--~~ 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: Mock Location Provider [SOLVED+IMPROVED]
Hi Justin, the interesting enhancement wasn't the journey, but it was the interpolation of route-points. One may now make a road of 2 points and the mock-provider can make a route of arbitrary many points out of these two. So if one has a straight route between 2 cities, the provider creates a "smooth" route between the cities. Stefan Am Dienstag, den 09.09.2008, 11:21 -0700 schrieb Justin (Google Employee): > Thanks Stefan, for providing the additional route. I just included a > trivial one and the hope is that users will input what ever route data > source makes sense for them. > > In the future I might work on enhancing the program to include a set > of routes to choose from and the ability to just specify different > data sources like a URL, file path, or content provider. > > Cheers, > Justin > Android Team @ Google > > On Sep 3, 9:56 am, Stefan Handschuh <[EMAIL PROTECTED]> wrote: > > I somehow improved Justins code. > > > > Seehttp://pastebin.com/m1f06415f > > > > It has now a New-York based journey (longer than before) and the > > time-interval between each points can be set so that the update inveral > > (set to 500ms) can be arbitraryly small (see line 177) > > > > @Justin: if you like it, please include it in you zip-file > > > > > I just posted some code > > > athttp://groups.google.com/group/android-developers/web/mock_provider.zip > > > that implements a mock location provider. This runs entirely in the > > > emulator, so it should work across all platforms. It allows you to > > > specify a set of coordinates and will the just loop through them > > > forever. This could easily be adapted to read data from a file, URL, > > > etc. As Stefan points out > > > onhttp://groups.google.com/group/android-developers/browse_frm/thread/2... > > > , its important to set the time value on the Location you pass to the > > > location service. If a new Location has the same time value as the > > > previous one the LocationManager received, the location won't be > > > updated. > > > > > You should be able to compile this, install it on the emulator, run > > > it, and then see the location change in Maps application. > > > > > Hopefully this puts it all together and resolves issues that many have > > > been encountering. > > > > > Cheers, > > > Justin > > > Android Team @ Google > > --~--~-~--~~~---~--~~ 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: Mock Location Provider [SOLVED+IMPROVED]
Small correction: http://pastebin.com/m684e7561 On Sep 3, 6:56 pm, Stefan Handschuh <[EMAIL PROTECTED]> wrote: > I somehow improved Justins code. > > Seehttp://pastebin.com/m1f06415f > > It has now a New-York based journey (longer than before) and the > time-interval between each points can be set so that the update inveral > (set to 500ms) can be arbitraryly small (see line 177) > > @Justin: if you like it, please include it in you zip-file > > > I just posted some code > > athttp://groups.google.com/group/android-developers/web/mock_provider.zip > > that implements a mock location provider. This runs entirely in the > > emulator, so it should work across all platforms. It allows you to > > specify a set of coordinates and will the just loop through them > > forever. This could easily be adapted to read data from a file, URL, > > etc. As Stefan points out > > onhttp://groups.google.com/group/android-developers/browse_frm/thread/2... > > , its important to set the time value on the Location you pass to the > > location service. If a new Location has the same time value as the > > previous one the LocationManager received, the location won't be > > updated. > > > You should be able to compile this, install it on the emulator, run > > it, and then see the location change in Maps application. > > > Hopefully this puts it all together and resolves issues that many have > > been encountering. > > > Cheers, > > Justin > > Android Team @ Google --~--~-~--~~~---~--~~ 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] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Mock Location Provider [SOLVED+IMPROVED]
I somehow improved Justins code. See http://pastebin.com/m1f06415f It has now a New-York based journey (longer than before) and the time-interval between each points can be set so that the update inveral (set to 500ms) can be arbitraryly small (see line 177) @Justin: if you like it, please include it in you zip-file > I just posted some code at > http://groups.google.com/group/android-developers/web/mock_provider.zip > that implements a mock location provider. This runs entirely in the > emulator, so it should work across all platforms. It allows you to > specify a set of coordinates and will the just loop through them > forever. This could easily be adapted to read data from a file, URL, > etc. As Stefan points out on > http://groups.google.com/group/android-developers/browse_frm/thread/2b71c14f34dd8788 > , its important to set the time value on the Location you pass to the > location service. If a new Location has the same time value as the > previous one the LocationManager received, the location won't be > updated. > > You should be able to compile this, install it on the emulator, run > it, and then see the location change in Maps application. > > Hopefully this puts it all together and resolves issues that many have > been encountering. > > Cheers, > Justin > Android Team @ Google > > --~--~-~--~~~---~--~~ 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] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: GPS LocationProvider journey simulation
Did you get the journey working with this one? On Aug 28, 9:50 pm, munzelmann <[EMAIL PROTECTED]> wrote: > For those who are still struggling with ddms and location updates: > > I got this issue solved by moving my development tools from a German > Windows XP to Debian Linux with an English locale. > So it seems that ddms location updates are broken on Windows XP and/or > German (or any non english?) Locale. --~--~-~--~~~---~--~~ 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] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Simple Mock Location Provider
Don' forget to set the current time to the location! location.setTime(System.currentTimeMillis()); > setTestProviderLocation("gps", location) doesn't wake up my > LocationListener (minDistance 0, minTime 0 when requesting updates). > I am forced to use geo fix via telnet > > On 27 août, 10:27, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > Here is what i have done: > > > > private void setTestLocation(double lat, double lng) { > > Location location = new Location("gps"); > > location.setLatitude(lat); > > location.setLongitude(lng); > > locationManager.setTestProviderLocation("gps", location); > > > > } > > > > Using LocationManager.GPS_PROVIDER is better style, i guess, but > > calling this with: > > > > setTestLocation(40.738412973944534,-73.98468017578125); > > > > takes your emulator straight to Manhattan. :-) > > > > The tools that come with 0.9 beta seem to be broken, so using KML/GPX > > replay via eclipse does not work (at least for me and some other > > people). > > > > On 25 Aug., 21:23, CG <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > > I'd just like to create to get alocation(not tracking, just get the > > > last postion fixed), but for my mocklocationprovider, I'd like this > > > fix change time to time. > > > > > I tried the old method by creating a new directory under thelocation > > > directory but it seems it does not work anymore (as documented by the > > > way :-) ). > > > > > I also add the test providers with the method : > > > public static void addMyMockLocationProvider(LocationManager locmgr) { > > > > > String mocLocationProvider = LocationManager.GPS_PROVIDER; > > > > > if (locmgr.getProvider(mocLocationProvider) == null || ! > > > locmgr.isProviderEnabled(mocLocationProvider)) { > > > locmgr.addTestProvider(mocLocationProvider, > > > false, false, false, > > > false, false, false, false, 0, 5); > > > > > > locmgr.setTestProviderEnabled(mocLocationProvider, true); > > >} > > > > > } > > > > > But I still don't have the position given in KML file I send thanks to > > > DDMS (or even GPX files) (I import files and then push on the "PLAY" > > > button when clickable). > > > > > I have the folowing error in the logcat: > > > 08-25 19:11:30.926: ERROR/LocationManagerService(52): > > > isProviderEnabled got exception: > > > 08-25 19:11:30.926: ERROR/LocationManagerService(52): > > > java.lang.IllegalArgumentException: provider=network > > > 08-25 19:11:30.926: ERROR/LocationManagerService(52): at > > > com.android.server.LocationManagerService._isProviderEnabled(LocationManagerService.java: > > > 1145) > > > 08-25 19:11:30.926: ERROR/LocationManagerService(52): at > > > com.android.server.LocationManagerService.isProviderEnabled(LocationManagerService.java: > > > 1131) > > > 08-25 19:11:30.926: ERROR/LocationManagerService(52): at > > > android.location.ILocationManager > > > $Stub.onTransact(ILocationManager.java:211) > > > > > I can't also succeed in having my currentlocationin the standard > > > maps application. The system still returns 0, 0 ! > > > > > Does anyone here can provide a quick step by step solution to have a > > > mocklocationprovider working ? > > > > > Thx ! > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to display a local file in the browser?
Why does this limit exists? If one wants to display html-code that has been fetched to view ONCE, this html-code has to be written in a content provider? On Aug 24, 12:49 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > So, creating a content provider, which returns the same content of the > file, would be accessed by loadUrl from webview, without any "url > filtering"? > Such as, for example... content://my.mailclient/231 > Should retrieve the content of file "231.html": content provider acts > as "webserver". > Is it right? > > On 24 Ago, 00:07, "Megha Joshi" <[EMAIL PROTECTED]> wrote: > > > In that case you should use the content provider option mentioned > > earlier...Using a content provider would allow images as the content > > provider would be used for image loading too. Another alternative is to put > > the image inline, using the data:// scheme. > > > On Fri, Aug 22, 2008 at 4:47 AM, [EMAIL PROTECTED] < > > > [EMAIL PROTECTED]> wrote: > > > > I already done that but there's another limit: data rendered via > > > loadData arenotable to load remote resources ( > > src="http://...";>). > > > > On 21 Ago, 22:21, "Megha Joshi" <[EMAIL PROTECTED]> wrote: > > > > On Wed, Aug 20, 2008 at 4:46 PM, Megha Joshi <[EMAIL PROTECTED]> wrote: > > > > > For security reasons, WebView doesnotallow "file:" access any more. > > > > > > If you want the link to be loaded in your activity, you should provide > > > a > > > > > WebViewClient and implement shouldOverrideUrlLoading with { return > > > false; } > > > > > This option doesnotwork anymore, sorry for the confusion! > > > > > So the only way to load local file contents into WebView, is as Gil > > > pointed > > > > out ...by loading the contents with loadData()/ > > > > > Sample code: > > > > static final int MAXFILESIZE = 8096; > > > > String path = uri.getPath(); > > > > File f = new File(path); > > > > final long length = f.length(); > > > > if (!f.exists() || length > MAXFILESIZE) { > > > > return; > > > > } > > > > > // typecast to int is safe as long as MAXFILESIZE < MAXINT > > > > byte[] array = new byte[(int)length]; > > > > > try { > > > > InputStream is = new FileInputStream(f); > > > > is.read(array); > > > > is.close(); > > > > } catch (FileNotFoundException ex) { > > > > // Checked for file existance already, so this shouldnot > > > happen > > > > return; > > > > } catch (IOException ex) { > > > > // read or close failed > > > > Log.e(LOGTAG, "Failed to access file: " + path, ex); > > > > return; > > > > } > > > > mWebView.loadData(new String(array), mimeType, null); > > > > > There is a 8KB limit on the file size. So if your data is more that 8KB, > > > you > > > > should create a content provider > > > > for your files and then the use the ContentResolver.openContentURI()... > > > > > > On Wed, Aug 20, 2008 at 4:34 PM, [EMAIL PROTECTED] < > > > > > [EMAIL PROTECTED]> wrote: > > > > > >> I used WebView to display rich content emails (I'm writing a mail > > > > >> client). It worked well loading URI such as > > > > >> file://sdcard/filewhateveryouwant.xxx > > > > >> ... > > > > >> Now I upgraded to 0.9 and Android OS is displaying me apagewith "The > > > > >> requested file wasnotfound." > > > > > >> Maybe a PERMISSION issue? > > > > > >> On 19 Ago, 20:36, "Megha Joshi" <[EMAIL PROTECTED]> wrote: > > > > >> > Browser doesnotsupport viewing local files... > > > > > >> > On Tue, Aug 19, 2008 at 12:38 AM, Peli <[EMAIL PROTECTED]> > > > wrote: > > > > > >> > > Is it possible to open a local file in the browser? > > > > > >> > > In the Android browser, I tried menu / go to: > > > > >> > > file:///sdcard/test.html > > > > > >> > > I always receive the error message: > > > > >> > > "Webpagenotavailable. > > > > >> > > Thewebpageat file:///sdcard/test.html couldnotbe loaded as: > > > > >> > > The requested file wasnotfound." > > > > > >> > > even though the files exist in /sdcard/test.html. > > > > >> > > Do I have to use a different URL, or put files into a different > > > > >> > > folder? > > > > > >> > > Peli > > > > > >> > > PS: From within an application, there seems to be a way to load > > > local > > > > >> > > files: > > > > > >> > > "The prefix "file:///android_asset/" will cause WebView to load > > > > >> > > content from the current application's assets folder." > > > >http://code.google.com/android/reference/android/webkit/WebView.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-
[android-developers] Re: Socket & HttpURLConnection don't work?
Hi Brad, you just have to add to your AndroidManifest.xml . This is NOT mentioned in http://code.google.com/android/migrating/m5-0.9/changes-overview.html but written here in the list. Stefan Am Dienstag, den 19.08.2008, 21:08 -0700 schrieb brad: > Hi, > > I had used java.net.HttpURLConnection or java.net.Socket to get a > image via HTTP protocol. > But it always got "java.net.SocketException : unknown error" message. > Why??? > Does 0.9-SDK support network operation??? > Thanks in advance. > > Brad. > > > my code: > Bitmap bitmap = null; > InputStream in = null; > int response = -1; > try { > //we use URLConnection because it's anticipated > that it is lighter- > weight than HttpClient > //NOTE: At this time, neither properly support > connect timeouts > //as a consequence, this implementation will > hang on a failure to > connect > URL url = new URL("http://10.0.2.2/test.jpg";); > URLConnection conn = url.openConnection(); > if (!(conn instanceof HttpURLConnection)) throw > new > IOException("Not an HTTP connection."); > HttpURLConnection httpConn = > (HttpURLConnection) conn; > httpConn.setAllowUserInteraction(false); > //httpConn.setConnectTimeout(CONNECT_TIMEOUT); > //httpConn.setReadTimeout(SOCKET_TIMEOUT); > httpConn.setInstanceFollowRedirects(true); > httpConn.setRequestMethod("GET"); > httpConn.connect(); // <-- exceptoin occurs at > this line > response = httpConn.getResponseCode(); > if (response == HttpURLConnection.HTTP_OK) { > in = httpConn.getInputStream(); > bitmap = BitmapFactory.decodeStream(in); > } > } finally { > if (in != null) try { > in.close(); > } catch (IOException e) { > /* ignore */ > } > } > > > --~--~-~--~~~---~--~~ 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] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Taking care of proxy Internet access for Dev Challenge?
You should relax! IF the proxy-setting would be THIS important, there would be a hint and a proper support by Adnroid itself. But testing is not that complicated: just serach for "public proxy" and select a anonymous (don't take a transparent one). > Bump. I'd also like to read an official clarification about proxies. > > On Apr 11, 4:34 am, "Harsh Jain" <[EMAIL PROTECTED]> wrote: > > BUMP. Cant we expect judges to just use -http-proxy flag ? I have not taken > > care of proxy issues in my app. Please let us know. > > > > Regards, > > harsh > > > > On Fri, Apr 11, 2008 at 4:58 PM, joos <[EMAIL PROTECTED]> wrote: > > > > > Is there an offical answer from google regarding this? > > > > > I would rather not have to care about this, since it is difficult to > > > test this anyway. I would have to set up a proxy and so on. > > > > > I think I will not handle proxy access in my app and rather add a note > > > to my readme file, that my prototype requires direct internet access. > > > > > (Android is beta anyway, so they can't require complete nifty > > > outprogrammed solutions anyway - with the next sdk api release we > > > would have to make migrations/changes anyway) > > > > > Greetings, > > > Joos > > --~--~-~--~~~---~--~~ 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] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Taking care of proxy Internet access for Dev Challenge?
Proxies are the STANDARD-way for you mobile device to connect to the internet. I have never owned a device that doesn't use a proxy server. But: Android makes no devision into HTTP and HTTPS which is a huge disadvantage > I'm becoming confused with all of the guidance being given to entrants > of the ADC. > > One the one hand, the flavour of the posts in the Challenge group is > that we are not permitted to instruct the user to do anything to their > emulator. This seems to include pushing files to it, installing an > supplied SD Card image or even installing more than one application > package. > > But unless I have been totally left behind (and its quite possible), > this is just what you need to do to Android's own browser to use a > proxy: > > http://groups.google.com/group/android-developers/browse_frm/thread/e855c4998b25fc9c/d8cb5935a609b8cc?#d8cb5935a609b8cc > > Further to this, there is even no way to make the built-in Google Maps > application to work: > > http://groups.google.com/group/android-developers/browse_frm/thread/b02397ad796ce280/418ee733c7553f71?lnk=gst&q=proxy#418ee733c7553f71 > > Perhaps I'm mistaken in this, I don't have much experience with mobile > phone development, but isn't a proxy configuration something of an > abnormality for a mobile device? > > Tom. > > On Apr 9, 10:43 pm, "David McLaughlin (Android Advocate)" > <[EMAIL PROTECTED]> wrote: > > Yes; just as your end-user may end up using your app from behind a > > proxy, you should assume that your judges may also. > > > > Thanks, > > David > > > > On Apr 8, 8:54 am, joos <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > I am building a client/server application for the Developer Challenge > > > where my Android Client accesses some Server to retrieve information. > > > > > Does anyone know if I have to take care handling Internet access > > > through a firewall/proxy within my application? > > > (I would have to read the proxy values from the settings.db and add > > > the values to my openConnection call - I guess) > > > > > Greetings, > > > Joos > > --~--~-~--~~~---~--~~ 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] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---