[android-developers] Re: File Handling in Android
you can use most normal Java File operations. If you want to access the sd card you will need to set the necessary permissions. Sunny greetings from Zurich, Stephan Wiesner On 13 Jan., 10:47, tejas_muley tejasmule...@gmail.com wrote: Hi Android Team, I try to create folder in android app, that folder used only in application in which its create that folder. Can this is possible or is there any folder (already provided by android ) which work like this. Please help me to solve this problem. Thanks in advance. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Tool for handling of localisation files
Thanks, that looks very interesting. Not the thing I am looking for in my current project but certainly worth looking at for others :-) Anybody else? Don't tell me you are all using the default Eclipse XML editor for your translations? Stephan On 16 Jan., 11:11, Pent supp...@apps.dinglisch.net wrote: I am working on a App that supports several languages and got an offer to have my strings.xml file translated into several languages. However, the persons doing that are not technical and I would really prefer to give them an Excel file or something like that. Anybody using something else than a pure XML editor to handle translations? I use this:http://mygengo.com/translation-services/string/ Not perfect, but not bad. Pent -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Creating step-by-step tutorial in app
What I do in one of my apps (see middle screenshot) https://market.android.com/details?id=de.stephanwiesner.fotocommunity is that I display a popup that contains a custom dialog displaying an image. Sitze set to just fit the picture. In my case it can be zoomed and panned, but it could easily include swipe detection and not be movable. Just thinking about it, I believe that is exactly what I will do to include a first-start-tour-of-the-app .-) What you can also see in the screenshot is that there are two menu bars. The user can show/hide them with a tap. In your case this could be a navigation bar to make sure that the user can skip the tutorial or whatever you want him to be able... Greetings from Lucerne, Stephan Wiesner On 17 Jan., 04:55, Kookamonga site...@yahoo.ca wrote: Excellent, SurfaceView, just learned something new. Thanks, I'll have a look. On Jan 16, 10:48 pm, Kristopher Micinski krismicin...@gmail.com wrote: Nonsense, you can also have something like a surfaceview that displays the picture, and also does dynamic drawing of the cute indicator button :-) kris On Mon, Jan 16, 2012 at 10:37 PM, Kookamonga site...@yahoo.ca wrote: Yup, I thought of that... This is why I initially suggested it was just an ImageView that was listening for gestures to move between successive ImageViews. That would work. But the only way I can think of getting the nice page indicator at the bottom would be to hardcode it as part of the image in the ImageView. And obviously, this is less than desirable: adding a page to the tutorial means re-doing every page to update the page indicator, etc. I thought maybe there was something I hadn't come across in my Googling for the answer. On Jan 16, 10:30 pm, Kristopher Micinski krismicin...@gmail.com wrote: Honestly, they might just be screenshots arranged in a custom view that does that cute scrolling thing... kris On Mon, Jan 16, 2012 at 10:22 PM, Kookamonga site...@yahoo.ca wrote: Yes, I will try and find an example and look at the source. In the meantime, just so we're clear, I've uploaded images for the first two pages of the tutorial: http://tinypic.com/r/eh19n8/5 http://tinypic.com/r/35m2v0k/5 Nice, eh? On Jan 16, 10:02 pm, Kristopher Micinski krismicin...@gmail.com wrote: On Mon, Jan 16, 2012 at 9:51 PM, Kookamonga site...@yahoo.ca wrote: OK, thanks Kris. I was looking to find out whether there was a special view that did this sort of thing. Appears not to be the case. And yeah, I can figure out other ways to get the same effect. Not to say that it's not *possible* to write a fancy view that embeds other views and adds some niceties to do demo stuff, I'm sure it's possible to write such a view, it's just not out there on the Android platform. But ultimately this might be what a few of those apps use. Perhaps you can find an example app, then check out it's source? kris -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Tool for handling of localisation files
Hi, I am working on a App that supports several languages and got an offer to have my strings.xml file translated into several languages. However, the persons doing that are not technical and I would really prefer to give them an Excel file or something like that. Anybody using something else than a pure XML editor to handle translations? Thanks and greetings from Lucerne, Stephan Wiesner -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android fragmentation study
I agree and actually profit from it. As a private developer I hate that I have to write Bugfixes for single devices/Android versions (just thinking of the Galaxy SI lagfix thing gets me goosebumbs) but in my professional life I am a software tester and we actually earn our money by offering our clients to have us test their apps on different devices/Android versions. As Dianne mentioned there are actually not _that_ many differences/ bugs, but they are real and they can get very expensive (again think lagfix). Greetings from Zurich, Stephan Wiesner On 11 Jan., 23:31, Christopher Van Kirk christopher.vank...@gmail.com wrote: Yeah, I would respectfully disagree with your assessment. Making software is a business. An investment. To reap maximum rewards on that investment the product has to have as much reach as possible, meaning the OP is absolutely on point about OS upgrades. Who is going to spend 10k, 100k, 1m, etc, developing an app whose target market is less than 1% of active installs? 4.0 won't be an attractive target for developers until it commands at least 80% of the installed market, which will likely take at least a year to occur, perhaps longer. Comparing handset differences with browser difference is just absurd. How many browser versions are there? Five maybe six? An average Android app has to deal with over 600 different devices today. That's a difference of 100x. This number is also growing at an exponential rate, so even if you can manage to test on all of those devices, in three months you'll probably have to do the same number again. What you're apparently not appreciating is that unlike the PC/Mac world, the Android world lacks strong compatibility standards and more importantly, conformance testing. As a consequence, devices tend to have niggling and chronic differences that in aggregate make for an inconsistent and unstable feel for the platform. You really have to have a very large operation or have a very unambitious app to make an app with long reach in the Android world. By contrast, the Apple approach is that one size fits all. From a small or independent developers perspective this really is preferable, because you know if you test it and it works on one device it's going to work on all of them, and there are millions of them out there. You simply don't have that guarantee in Android. It's no accident that the most profitable app market is to be found on Apple devices. Don't get me wrong. I'm not an Apple fan. But having spent considerable time fighting with device peculiarities in the Android ecosystem instead of adding features to my app, I find that I long for the simplicity that the Apple ecosystem guarantees. On 10/28/2011 12:01 AM, Studio LFP wrote: Eh, it's not that bad. If you look at the history of developers, we're already use to having to deal with a lot worse fragmentation issues than Android. Anyone that's ever developed a website correctly knows that supporting the available web browsers is a lot more of a challenge than with Android versions. Windows, Mac OSX, a ton of server technologies, databases, etc., they all have tons of different versions available to support. Most companies stick with older versions because it is what they have and it is working. When it comes to Android, I've been pleasantly surprised at the efforts Google has gone through to help manufacturers upgrade. Even though 2.1, 2.2 and 2.3 are different, they aren't so much different that in most cases you can't treat them as 2.x. It seems to me that Android is more broken up in 1.x, 2.x, 3.x and now 4.x instead of the individual versions themselves. I'd rather a little fragmentation in Android than for them to pull an Apple and everyone is the exact same, right down to the hardware level. Variety is something we need in the mobile market, not a one device fits all concept. Steven Studio LFP http://www.studio-lfp.com On Thursday, October 27, 2011 10:36:24 AM UTC-5, Greg Donald wrote: http://theunderstatement.com/post/11982112928/android-orphans-visuali... http://theunderstatement.com/post/11982112928/android-orphans-visuali... Wow.. I knew it was bad, but man. most app developers will end up targeting an ancient version of the OS in order to maximize market reach. I totally agree.. It will literally be years before I will begin to care about the new 4.0. I'm still supporting devices running 2.1 and will be for some time to come. -- Greg Donald -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received
[android-developers] Tool for localisation file handling (non XML)
Hi, I am working on a App that supports several languages and got an offer to have my strings.xml file translated into several languages. However, the persons doing that are not technical and I would really prefer to give them an Excel file or something like that. Anybody using something else than a pure XML editor to handle translations? Thanks and greetings from Lucerne, Stephan Wiesner -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Proguard fails on second run with Conversion to Dalvik format failed with error 1
Hi I am trying to get proguard running but keep running into problems. I use Eclipse and have a fresh system (Java, Eclipse, everything freshly installed and updated, keystore created new in eclipse) Export of signed APK works exactly once! On second run (no changes in the code or the configuration) I get an error (see below) This happens on different apps, even newly created with no custom code of mine at all, and on different machines. My project.properties just contain: target=android-7 proguard.config=proguard.cfg my proguard was not touched at all (eclipse default) com.android.ide.eclipse.adt.internal.build.DexException: Conversion to Dalvik format failed with error 1 at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:756) at com.android.ide.eclipse.adt.internal.project.ExportHelper.exportReleaseApk(ExportHelper.java:207) at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.doExport(ExportWizard.java:290) at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.access$0(ExportWizard.java:229) at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard$1.run(ExportWizard.java:214) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121) Any help apreciated! Thanks, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Proguard fails on second run with Conversion to Dalvik format failed with error 1
Cool, thanks a lot! Just replaced the lib directory with that of the latest download and everything seems to work now :-) Puh worked for days on this one . . . Greeting from Lucerne, Stephan On 10 Jan., 03:37, Nikolay Elenkov nikolay.elen...@gmail.com wrote: On Mon, Jan 9, 2012 at 7:59 PM, Stephan Wiesner testexpe...@googlemail.com wrote: Export of signed APK works exactly once! On second run (no changes in the code or the configuration) I get an error (see below) This happens on different apps, even newly created with no custom code of mine at all, and on different machines. Replacing the ProGuard jars with the newest ones (from the project's website) fixes this error for me (happens every time with the ADT libs). -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android unit testing with ContentProviders and databases
I guess you gave the obvious answer yourself: Don't hardcode the name. Use a variable, maybe a system setting or something from a config file that can be accessed by all your apps and put an if/else block in your provider Greetings from Berne, Stephan On 31 Dez., 01:05, barry barry.drinkwa...@gmail.com wrote: I have an app that uses a ContentProvider to serve data instead of directly accessing the database. The application is working as expected but I have a problem with unit tests: how can I force the ContentProvider to use a test database rather than a 'live' one? If I wasn't using a ContentProvider I could pass a different database name to the Constructor of my `SQLiteOpenHelper` sublass, but now the database is created with a call to onCreate() in my ContentProvider: @Override public boolean onCreate() { UKMPGDataProvider.init(getContext(), Constants.DATABASE_NAME); return (UKMPGDataProvider.getWritableDatabase() == null) ? false : true; } As you can see, the database name is hardcoded. Is there a way to pass a test name into the ContentProvider? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Is it worth to load pictures in parallel ?
Hi, I am creating an app for a foto-community and it displays, well, photos .-) On opening the gallery I am loading the latest 30 thumbnails (15kb each) into a Gallery and the first large picture (about 350kb). There is a swipe navigation and that becomes very painfull it one has to wait for each picture to load. After download all pictures are cached on the phone. I am thinking about (pre)loading several pictures in parallel but all the threading and handling of the GUI updates from background threads, etc. is making me nervous. Anybody experience with it? Will the downloads be significantly faster in wifi and what about in 3G? Thanks and greetings from snowy Lucerne, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to install sqllite database browser in android emulator
You can just pull the database file to your computer and open it with any sqlite browser. Firefox has a nice extension. personally i usually write some dump-methods for convenience sake so that i can dump certain testdate to logcat on the device and only use a real tool if I am really stuck .-) Greetins from Lucerne, Stephan Am 11. Dezember 2011 16:54 schrieb Samuel jrl...@gmail.com: Hi, I am developing android application using emulator I need a tool to browse the database. What kind of tool that can work with android emulator how to use it? Many thanks, 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 android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Open Browser with HTML page from sdcard
Hi, I need to open a html file that sits on my sdcard in my default browser. The code works fine if the file is on the net or in my asset folder, but if I want to open it from the sdcard I get an 12-11 08:06:34.650: E/AndroidRuntime(6829): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=content:///mnt/sdcard/ download/stocks.html?text/html } // String url = file:///android_asset/stocks.html; // String url = file:///mnt/sdcard/ download/stocks.html; String url = content:///mnt/sdcard/download/stocks.html?text/ html; //File sdCard = Environment.getExternalStorageDirectory(); //File dir = new File(sdCard.getAbsolutePath() + /download/ stocks.html); Intent i = new Intent(Intent.ACTION_VIEW); i.addCategory(android.intent.category.BROWSABLE); i.setData(Uri.parse(url)); startActivity(i); Anything else I need to set on the Intent to make it realize that I want to open a browser? Thanks, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Google Maps API Key not working? Only Grid!
You need to have two keys. The one shown looks like a production key? Then it only works if you export your app. For development you need to use your development cert file (see google docu). Sunny greetings from Zurich, Stephan On Apr 5, 8:43 pm, BroOf kontaktpl...@googlemail.com wrote: I just included the Google Maps API into my project but I can't get it to work... My debug.keystore is located in: C:\Users\myusername\.android I copied it to E:\Android and generated the MD5 fingerprint like this: C:\Program Files\Java\jdk1.6.0_24\binkeytool.exe -list -alias androiddebugkey keystore E:\Android\debug.keystore -storepass android -keypass android This was the fingerprint I got (deleted the last 6 chars): 7F:CA:45:08:3C:71:36:8F:7B:F5:93:24:13:XX:XX:XX Then I built my apiKey on the official website. This is what I got (deleted the last 6 chars): 0gIn_B6b3tH9UYB7Wl1AimWyQND7IdayPxx In my main.xml I included the code for displaying the map: com.google.android.maps.MapView xmlns:android=http://schemas.android.com/apk/res/android; android:id=@+id/mapview android:layout_width=fill_parent android:layout_height=fill_parent android:clickable=true android:apiKey=0gIn_B6b3tH9UYB7Wl1AimWyQND7IdayPxx / The permissions are set, too! But if I run my application it shows me an empty map (Only the grid is shown)! I tried it about 20 times without success. Any help here? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] webview No cache file for url
Hi, I have a webview and use caching. This worked fine until now. On my Motorola Defy (Android 2.1) I can not open webpages anymore. I have not changed anything on the code of the webview activity. Under preferences/applications I can see that the cache size is 0. 04-06 21:50:35.452: DEBUG/Alpenkalb(19966): Start webview: http://gipfelbuch.ch/tourenfuehrer/uebersicht/region/1 04-06 21:50:35.452: DEBUG/Alpenkalb(19966): [ 04-06 21:50:35.499 19966:0x4e13 D/No cache file for url http://gipfelbuch.ch/tourenfuehrer/uebersicht/region/1 Here is how I enable caching: webView.getSettings().setDomStorageEnabled(true); // Set cache size to 8 mb by default. should be more than enough webView.getSettings().setAppCacheMaxSize(1024 * 1024 * 8); // didn't work for me without this line webView.getSettings().setAppCachePath(/data/data/ch.gipfelbuch/cache); webView.getSettings().setAllowFileAccess(true); webView.getSettings().setAppCacheEnabled(true); Any ideas? Thanks, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: webview No cache file for url
Yes.Especially as I did not change anything in the activity class at all and it worked for weeks. Looking at my HTC Desire HD under settings/application I can see that there is a cache used by the app. All normal there. So it seems something broke on the defy as it even works on the emulator in 2.1 Of cource I tried to deinstall everything, etc, but no use :-( Stephan On Apr 6, 10:21 pm, Kostya Vasilyev kmans...@gmail.com wrote: 06.04.2011 23:57, Stephan Wiesner ?: // didn't work for me without this line webView.getSettings().setAppCachePath(/data/data/ch.gipfelbuch/cache); Are you sure this path is correct for that particular device / firmware? Does it match what is returned by Context.getCacheDir? http://developer.android.com/reference/android/content/Context.html#g...() -- Kostya Vasilyev --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] WebActivity: How to prevent page not found messages
Hi, when using WebActivites, I want to display a friendly page not found message to the user when the phone is offline. I do not want to display the default message that shows the URL that could not be loaded. Any way I can catch those page not found messages and display a local html file instead? Thanks, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] GPS does not stop after ending my app
Hi, I have an app that uses MapView to display data. It uses locationManager to determine the position of the user and if use of GPS is allowed by the user, GPS is used. The problem is that the app does not stop using the GPS (and draining battery). I start it using: locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1000 * 60, 20, new GeoUpdateHandler()); I tried this in onPause() and/or onDestroy(), but it does not help, though the methods are @Override protected void onPause() { super.onPause(); locationManager.removeUpdates(this); log(pause); } @Override protected void onStart() { super.onStart(); locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1000 * 60, 20, this); log(onstart); } Any ideas? Thanks, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: GPS does not stop after ending my app
Hi TreKing, thanks for your answer. I removed the new GeoUpdateHandler, but that does not help. My Activity extends LocationListener: public class ShowMap extends MapActivity implements LocationListener so if I provide this on both methods it should work, should it not? @Override protected void onStart() { super.onStart(); locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1000 * 60, 20, this); log(onstart); } @Override protected void onPause() { super.onPause(); locationManager.removeUpdates(this); log(pause); } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: GPS does not stop after ending my app
only it does not stop the GPS :-( On Mar 21, 3:03 pm, TreKing treking...@gmail.com wrote: On Mon, Mar 21, 2011 at 8:53 AM, Stephan Wiesner testexpe...@googlemail.com wrote: so if I provide this on both methods it should work, should it not? Yes. I would pair onStart() with onStop() or onPause() with onResume(). --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: GPS does not stop after ending my app
Got it. I have to use MyLocationOverlay.disableMyLocation() as well. Works fine now. Thanks for your advice! Stephan On Mar 21, 4:49 pm, TreKing treking...@gmail.com wrote: On Mon, Mar 21, 2011 at 10:32 AM, Stephan Wiesner testexpe...@googlemail.com wrote: only it does not stop the GPS :-( I would double check your code and make sure you're not adding an extra listener somewhere. Also wait a few seconds for the GPS icon to go away before assuming it's not working. Debug your code and make sure all your points are being hit as expected. Inspect the values for anything strange. --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Make and Imageview go in Fullscreen mode
Hi Pedro, I have a gallery with previews and when the user taps one he gets a large image. Depending on portrait/landscape mode of the mobile and the picture, the picture fills all the screen below the gallery (no sense in hiding the gallery). There is a preview here: http://stephanwiesner.de/alpenkalb/beta.htm (2nd picture) My xml looks like this: ?xml version=1.0 encoding=utf-8? RelativeLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent android:background=#ff00 Gallery android:id=@+id/gallery1 android:layout_width=fill_parent android:layout_height=wrap_content / ImageSwitcher android:id=@+id/switcher1 android:layout_width=fill_parent android:layout_height=fill_parent android:layout_below=@+id/gallery1 /ImageSwitcher TextView android:layout_width=fill_parent android:id=@+id/ album_comment android:gravity=center_horizontal android:text=Klicken Sie ein Bild android:layout_height=wrap_content android:textColor=@color/ album_text android:background=@color/menu_background android:layout_alignParentBottom=true/ /RelativeLayout Sunny greetings from Lucerne, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] (JSON) Download fails in 2.1 but works in 2.2
Hi, I use JSON as an interface and my code works fine on 2.2 devices but fails on motorola 2.1 devices The reason is that not the whole JSON file is downloaded, but only some (always the same) part and than it stops. URL url = new URL(http://www.somelink;); picCounter = 0; URLConnection ucon = url.openConnection(); InputStream is = ucon.getInputStream(); BufferedInputStream bis = new BufferedInputStream(is); ByteArrayBuffer baf = new ByteArrayBuffer(50); int current = 0; while ((current = bis.read()) != -1) { baf.append((byte) current); } // breaks in 2.1 but works in 2.2 String text = new String(baf.toByteArray()); Is there an IO issue in 2.1? Thanks, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: (JSON) Download fails in 2.1 but works in 2.2
Solved it by using: /** * This seems to work in both Android 2.1 and 2.2 */ public static String loadStream(String link) throws Exception { URL url = new URL(link); Log.d(TAG, Loading from URL= + url); InputStream is = null; DataInputStream dis; is = url.openStream(); dis = new DataInputStream(new BufferedInputStream(is)); StringBuffer sb = new StringBuffer(); String s = null; while ((s = dis.readLine()) != null) { // Log.d(TAG, s); sb.append(s); } return sb.toString(); } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Mapview ArrayIndexOutOfBoundsException in java.util.Vector.elementAt
You might have to do some catching of exceptions in your ItemizedOverlay and/or LocationOverlay classes. There are some bugs eg on Motorola phones that lead to unexpected exceptions on some phones/ versions of phones/versions of Android. I can't find the links at the moment, there is a discussion of this on stackoverflow... Greetings from Lucerne, Stephan On Mar 13, 4:17 pm, Ricky arsenickiss7...@gmail.com wrote: I really need some help. I have a report of a force close with this stack trace, and I cant find any information on how to prevent this type of error. java.util.Vector.elementAt(Vector.java:331) com.google.googlenav.map.Map.drawTile(Unknown Source) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to share data among different devices
Well, you can always implement a sync service on a remote server. Using JSON objects this is surprisingly easy Sunny greetings from Zurich, Stephan On Mar 8, 12:34 am, ez qzh...@gmail.com wrote: If a user has a Android phone and Android tablet, how to share the preference data and database data among different devices for this user. We are looking a way to sync the user's data among different devices. Any suggestions and ideas are appreciated. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to set ImageView from internal storage (or SDCard)
Thanks, got it :-) Sunny greetings from Lucerne, Stephan On Mar 4, 11:27 pm, Streets Of Boston flyingdutc...@gmail.com wrote: BTW: There is a BitmapFactory.decodeFile(String pathName) as well... you could skip the second and third step from my post above :-) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to set ImageView from internal storage (or SDCard)
Thanks for your reply. Thats exactly what I need, though: The path to the internal storage. I download the files and can access them using File() of course, but how do I access them from BitmapFactory?. Probably obvious, if you know it, but I don't get it :-( Stephan On Mar 3, 10:45 am, Doug beafd...@gmail.com wrote: Use BitmapFactory and feed it the path of the file you saved, wherever you saved it. On Mar 2, 2:15 am, Stephan Wiesner testexpe...@googlemail.com wrote: Hi, my app displays some pictures I want to replace at certain intervals by downloading them from a webpage. I can set the image from my drawable folder, assets folder or by downloading it from a webpage: ImageView im = (ImageView) findViewById(R.id.SplashLogo); // url = file:///android_asset/pic.png; InputStream is = (InputStream) new URL(url).getContent(); Drawable d = Drawable.createFromStream(is, src name); What I want, however, is to display an image that I downloaded previously to internal storage (or sdcard if i have to). So: How do set the filename/folder to point to internal storage? Thanks, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to set ImageView from internal storage (or SDCard)
Hi, my app displays some pictures I want to replace at certain intervals by downloading them from a webpage. I can set the image from my drawable folder, assets folder or by downloading it from a webpage: ImageView im = (ImageView) findViewById(R.id.SplashLogo); // url = file:///android_asset/pic.png; InputStream is = (InputStream) new URL(url).getContent(); Drawable d = Drawable.createFromStream(is, src name); What I want, however, is to display an image that I downloaded previously to internal storage (or sdcard if i have to). So: How do set the filename/folder to point to internal storage? Thanks, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Can I read .pdf From assert folder?
YOU can, but Acrobat reader does not have the permission. Had the same problem and decided to save the pdfs on the SD card... Greetings from Zurich, Stephan On Feb 28, 9:29 pm, Sunil Lakhiyani slakhiyaniandr...@gmail.com wrote: Hi Developers, I have .pdf in assert folder, also i have pdf viewer ad acrobat reader installed in my phone. Can i read .pdf from assert anyway (using those 2)? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Android Apps with HTML5
Hi, we have evaluated PhoneGap and JQTouch for my current project, as we are developing the app for IPhone and Android. We found the tools somewhat lacking on Android, though. I am sure that they will be great tools in the future but at the moment we prefere to go native. We do try to put as much content as we can into HTML, though. CSS will make sure that we can use the same content on IPhone and Android. Stephan On Mar 1, 1:47 pm, Diego N. diegonunes.sist...@gmail.com wrote: Hello I wonder if anyone here has developed applications for Android using Sencha Touch, PhoneGap, or Appcelerator Titanium? If yes, what I suggest? Thanks. -- Diêgo Nunes Assunção Give Peace a Chance -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to cache Websites
Hi, I develop an app that is very content centered. Content consists mostly of html pages (its basically an app version of an existing homepage with some added features like GPS and camera), so most of the app will just run inside a webview. The app is intended to be used mostly offline, though, so I need good caching mechanisms. Any ideas how to handle the caching? Basically I would need to check wether a html page and all pictures are already on the device and only load them otherwise. Do I need to parse the html for the links to the pictures or are there better ways to handle this? HTML 5 caching seems to work, but I don't feel that I am in control. For instance: The webview does react to my .manifest file - but caches pages that are not contained there too. Using this code, my pages are cached: webView = (WebView) findViewById(R.id.webview); webView.getSettings().setJavaScriptEnabled(true); webView.setWebChromeClient(new WebChromeClient() { @Override public void onReachedMaxAppCacheSize(long spaceNeeded, long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater) { quotaUpdater.updateQuota(spaceNeeded * 2); } }); webView.getSettings().setDomStorageEnabled(true); // Set cache size to 8 mb by default. should be more than enough webView.getSettings().setAppCacheMaxSize(1024 * 1024 * 8); Thanks, Stephan -- Interessiert an Android? http://android-schweiz.blogspot.com/ Whant to learn German? http://german-podcast.blogspot.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Blackbox testing android apps
Hi, anybody using testing tools for end2end/regression testing? As apps are often developed by outside contractors we do not have (full) control over the source code and need to be able to do blackbox testing. We are seeing more and more apps getting into trouble because of the explosion of testing effort (and Barcelona just made it worse :-). Testautomation to the rescue. But even HP does not yet support that. I am currently playing with http://code.google.com/p/robotium/ which is a good starting point. DeviceAnywhere offers blackbox testing, but they use pixels for object recognition (urgh). Anything else? Thanks, Stephan -- Interessiert an Android? http://android-schweiz.blogspot.com/ Whant to learn German? http://german-podcast.blogspot.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: GPS with Map overlay
Whats the stack trace? On 11 Feb., 08:59, Poifull unique.poif...@gmail.com wrote: Hi, I have got the following code but my application crash. Can anyone tell me what is wrong? Thanks! public class GPS extends MapActivity{ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: For those who are looking for testing their apps on multiple devices:
:-) No, there is no camera involved. They stream the userinterface to your pc and back. Looks exactly like the real thing. It is somewhat slow over the internet, but fast enough in an intranet. If you buy/rent an iphone, you get a real iphone and can send it any interaction (sms, touch, movement, etc.) you want and see what happens (like I said, no emulator). They have quite a range of devices, including different carriers. This is great for someone like me, who has to fight with bugs that only apear on certain phones (google maps on motorola defy in my case). That way I can install a build on that phone, see if it runs and evaluate any errors. Stephan -- Interessiert an Android? http://android-schweiz.blogspot.com/ Whant to learn German? http://german-podcast.blogspot.com On 31 Jan., 09:07, FrankG frankgru...@googlemail.com wrote: Hello Stephan, can you describe the kind of interface they provide to the different devices ? Or how the interaction during test should happen ? Do they provide a web cam view to the ui ? Thanks ! Frank On 30 Jan., 07:57, Stephan Wiesner testexpe...@googlemail.com wrote: For those who are looking for testing their apps on multiple devices: I had the chance to meet a guy from Device Anywhere last week. They wire mobile phones and put them into server racks. This allows remote control of them. No simulation, the real thing. Pretty cool… They offer a device pool that can be accessed remotely or one can buy the machines. This is useful for building an internal testlab in big companies. The test automation in the live demo looked pretty cool, too. Though I have seen too many “magic testing tools demos” In my live to believe it till I have tried it :-) Greetings from Berne, Stephan -- Interessiert an Android?http://android-schweiz.blogspot.com/ Whant to learn German?http://german-podcast.blogspot.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: XML or JSON in Android
I find JSON faster and much easier to use. Easier to produce the data as well :-) Stephan On 28 Jan., 20:20, Kumar Bibek coomar@gmail.com wrote: JSON is lighter, and is simple. :) Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com On Fri, Jan 28, 2011 at 1:17 PM, Ranveer ranveer.s...@gmail.com wrote: Hi All, I am developing an Android application. Following is my scenario: 1. I parsing XML in android which is hosted on server (same like RSS feed). 2. It takes around 10 second depend on network speed. 3. XML refresh on server in every 15 minutes. Is there any other way so I can make it more faster then current. Someone suggest me to use JSON instead of XML. Can some one suggest me; which format is better from XML and JSON (In term of fast execution and easy to use). regards -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] For those who are looking for testing their apps on multiple devices:
For those who are looking for testing their apps on multiple devices: I had the chance to meet a guy from Device Anywhere last week. They wire mobile phones and put them into server racks. This allows remote control of them. No simulation, the real thing. Pretty cool… They offer a device pool that can be accessed remotely or one can buy the machines. This is useful for building an internal testlab in big companies. The test automation in the live demo looked pretty cool, too. Though I have seen too many “magic testing tools demos” In my live to believe it till I have tried it :-) Greetings from Berne, Stephan -- Interessiert an Android? http://android-schweiz.blogspot.com/ Whant to learn German? http://german-podcast.blogspot.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Map View Error!
import com.google.android.maps.MapActivity; On 27 Jan., 10:57, peria abirami periaabir...@gmail.com wrote: If I put Classname extends MapActivity, it can't resolve that. If i put name extends Activiy, it resolve but the application forced to close.. Can any one help me on this issue -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Testing on Different Devices
Ask your friends to beta test it :-) Stephan -- Interessiert an Android? http://android-schweiz.blogspot.com/ Whant to learn German? http://german-podcast.blogspot.com On 25 Jan., 07:15, Nathaniel Warner warner.nathan...@gmail.com wrote: I want to test my free app on android phones other that the one I own but I can't afford to buy all the phones available. Is there some sort of standard testing method available to people in my situation? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Pretty sure Google Analytics for Android not working
GA works fine for me. Use it for about two weeks now and worked all the time. I use pageviews and event tracking and both are great things to improve my apps. Greetings from Lucerne, Stephan -- Interessiert an Android? http://android-schweiz.blogspot.com/ Whant to learn German? http://german-podcast.blogspot.com On 22 Jan., 23:27, Brill Pappin br...@pappin.ca wrote: OK, I'm pretty sure now that the Google Analytics for Android is not working. I pushed out an update on my free app about 48 hours ago. It logs a few custom vars and manually does a commit int he first several blocks of the startup code. It also doesn't shutdown until the app exists (which can be minutes, so I'm giving it plenty of time to sync). I don't know exactly how many of the 30k+ users have run the update (since the market doesn't tell me a darn thing), but i know I should have at least myself logged and I'm pretty sure some of the 30k users would have updated by now. My only conclusion is that its broken. Does anyone have a better solution than GAnalytics? Maybe one that actually works? - Brill Pappin -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Pretty sure Google Analytics for Android not working
As an add on, here is my code. I have set up TWO GA configurations, so that I can differ what my beta testers are doing and what my real users do. I needed that as well to be able to figure out how GA works. As you can see, I use automatic dispatching. Custom variables are used as well, but I have yet to find them in the GA interface. I personally find misusing event tracking a great way to see results like 41% of my users use Galaxy S phones (HTC is growing faster, though, the Desire HD seems to be the current phone of the day). This information led my to do a lot of performance tuning, as the Galaxy is so slow on disk/db operations. private void initTracker() { tracker = GoogleAnalyticsTracker.getInstance(); if (isReleaseVersion) { tracker.start(UA-xxx, 60, this); tracker.trackEvent(Gipfel, Version, VERSION, 1); tracker.trackEvent(Device, android.os.Build.BRAND.toLowerCase(), android.os.Build.MODEL.toLowerCase(), 1); tracker.trackEvent(Model, android.os.Build.MODEL.toLowerCase(), android.os.Build.FINGERPRINT, 1); tracker.trackEvent(Android, android.os.Build.VERSION.RELEASE.toLowerCase(), android.os.Build.FINGERPRINT, 1); tracker.trackPageView(android.os.Build.BRAND); } else tracker.start(UA-xxx, 60, this); ShowMap.tracker.trackPageView(/ShowMap); } On 23 Jan., 02:19, Hari Edo hari@gmail.com wrote: My GoogleAnalytics app is working fine, but it's not on the market yet so it's only getting about 150 events / day as I debug features at home. Are you calling .dispatch() occasionally? Queued up pageviews and events don't get sent to the server until (1) there's network, and (2) you call .dispatch() on the tracker object. On Jan 22, 5:27 pm, Brill Pappin br...@pappin.ca wrote: -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Performance issue with mapview when using large number of items
Thanks. My current solution is still that I only display markers in a certain radius of the center. That works fine, as the markers are peaks/cabins in the swiss alps and the user knows where the peaks are anyway. If I want to expand my app, though, I need a solution that scales. By now I have found several Javasript APIs, that handle this problem in a way similiar to what you suggested: by clustering markers. e.g.: http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/1.0/ I haven't found the time to solve that yet, as it is not pressing at the moment. But I will probably define areas (e.g. Berner Oberland, Wallis, Tessin) and countries and cluster the markers located there. Stephan --- Interessiert an Android?http://android-schweiz.blogspot.com/ Whant to learn German?http://german-podcast.blogspot.com On 21 Jan., 17:31, Brill Pappin br...@pappin.ca wrote: We had an issue like that in an experimental app we never released. What worked for us was that we merged points that were overlapping on the display depending on the magnification. The further in you go, the more those merge point break out, which keeps the number of points to a manageable level for the developer and a usable number for the user. You will need to create a custom point though so that it looks right and its clear that points are merged. - Brill Pappin -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Which phone for hardware testing?
Thats what I bought my SE Xperia Mini Pro for. Its not too expensive, small enough that i can carry it around with me all the time and has a hardware keyboard, which is great to make sure the app can be used with it. As it has only 600 MHz, I use it for performance testing, though in many cases it is faster than my f... Samsung Galaxy S. By now I don't support 2.1 anymore and upgraded the phone ( it is delivered with 1.6.). I found that none of my users had older phones, so... Stephan On 20 Jan., 14:39, Rok cliff.dav...@gmail.com wrote: I'm looking to support all phones back to 1.5 so am wondering what phone would be a good one to buy to test the application on slower CPU, lower resolution, etc.? Something in the nature of if it works on this, it'll work on mostly anything... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Marking points in a MapView
Here is an example that draws a point at the current center of the map. Move the map and you get another point with a line in between. You can see the result here: http://android-schweiz.blogspot.com/ Be careful, I am in the middle of writing the code,it's ugly but it does work. As you can see, there is indeed an ontab method and i really do use getProjection, as i want to do some custom drawing. If you just want to set a marker, there are easier ways. Google for any tutorial on that topic .-) Greetings from Berne, Stephan @SuppressWarnings(unchecked) public class TrackingOverlay extends ItemizedOverlay { Context mContext; private ArrayListOverlayItem overlays = new ArrayListOverlayItem(); private ArrayListGeoPoint points = new ArrayListGeoPoint(); public static final String TAG = ShowMap.TAG; private static Paint linePaint; public static String dateString = Date; public TrackingOverlay(Drawable defaultMarker) { super(boundCenterBottom(defaultMarker)); linePaint = new Paint(); linePaint.setColor(Color.GREEN); linePaint.setStrokeWidth(10); linePaint.setDither(true); linePaint.setStyle(Style.FILL); linePaint.setAntiAlias(true); linePaint.setStrokeJoin(Paint.Join.ROUND); linePaint.setStrokeCap(Paint.Cap.ROUND); populate(); } public void addOverlay(OverlayItem overlay) { overlays.add(overlay); setLastFocusedIndex(-1); // Each time we add a new OverlayItem, we must call populate(), which // will read each of out OverlayItems and prepare them to be drawn. populate(); } public void addItem(GeoPoint p) { Calendar cal = Calendar.getInstance(); DateFormat formatter = new SimpleDateFormat(); String date = formatter.format(cal.getTime()); // 09.06.06 14:00 MarkerOverlayItem item = new MarkerOverlayItem(p, points.size() + , Lat: + p.getLatitudeE6() + \nLong: + p.getLongitudeE6() + \n + dateString + : + date, points.size()); item.date = date; overlays.add(item); points.add(p); setLastFocusedIndex(-1); populate(); } public void repopulate() { populate(); } public void addOverlays(List list) { for (Iterator iterator = list.iterator(); iterator.hasNext();) { OverlayItem overlay = (OverlayItem) iterator.next(); overlays.add(overlay); } setLastFocusedIndex(-1); populate(); } public void draw(Canvas canvas, MapView view, boolean shadow) { // super.draw(canvas, view, false); int size = points.size(); if (size == 0) return; int rad = 15; RectF oval = null; Point lastPoint = new Point(); GeoPoint p = points.get(0); view.getProjection().toPixels(p, lastPoint); int x = lastPoint.x; int y = lastPoint.y; oval = new RectF(x - rad, y - rad, x + rad, y + rad); canvas.drawOval(oval, linePaint); } @Override protected OverlayItem createItem(int i) { return overlays.get(i); } @Override public int size() { return overlays.size(); } @Override protected boolean onTap(int index) { // anzeigen: Coordinaten, datum hinzugefügt Log.d(ShowMap.TAG, onTap + index); return true; } } On 19 Jan., 18:17, Dudero sinfanh...@googlemail.com wrote: Hello I want to mark( with a colored point) all the the positions which are clicked on the screen. I found something like overriding the onTap(GeoPoint p, MapView)- Method of an Overlay, but I do not understand how to draw then this points into a MapView. Do i have to call the draw()-method for each new point? Of course the GeoPoint has to be transformed into pixel-format with the getProjection().toPixels(GeoPoint gp,Point px)-method. Can somebody give me a good template? Greetz dudero -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Performance issue with mapview when using large number of items
Just for the records: Here is a description of a solution that uses a bitmap: http://stackoverflow.com/questions/1998375/android-mapview-panning-and-zooming-too-slow Stephan --- Interessiert an Android?http://android-schweiz.blogspot.com/ Whant to learn German?http://german-podcast.blogspot.com On 14 Jan., 05:45, Stephan Wiesner testexpe...@googlemail.com wrote: Now, thats an interesting idea. I will look into the bitmaps right away. I did check a lot of performance checking and tuning loading and creting my objects, thats smooth by now. I am not very experienced with the drawing part, though. Like you pointed out, the drawing is propably too expensive/done too often. Most of the time, the map just sits there after all... Thanks and tired greetings from Bern, Stephan On 14 Jan., 00:45, Bob Kerns r...@acm.org wrote: -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to implemennt OnZoomListener on MapView
Don't forget about all those SE phones that do not have pinch zoom (I am one of those). You might at least want to include the zoom controls. Stephan On 18 Jan., 22:40, bobetko bobe...@gmail.com wrote: I would like to have onZoomListener on my MapView. The code below is what I have done. It registers if zoom buttons are tapped. Since all new phones now supports pinch to zoom, this is useless. Does anybody have idea how to do real onZoomListener? Thanks. OnZoomListener listener = new OnZoomListener() { @Override public void onVisibilityChanged(boolean arg0) { // TODO Auto-generated method stub } @Override public void onZoom(boolean arg0) { Log.d(TAG, ZOOM CHANGED); // TODO Auto-generated method stub } }; ZoomButtonsController zoomButton = mapView.getZoomButtonsController(); zoomButton.setOnZoomListener(listener); -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Relief view on mapActivity?
No (at least I did not find a way to do that) :-( Would be great though. Stephan -- Interessiert an Android? http://android-schweiz.blogspot.com/ Whant to learn German? http://german-podcast.blogspot.com On 15 Jan., 00:38, José Gil jgilrin...@gmail.com wrote: Hi all! Is it possible to select the relief view in a mapActivity? I'm looking for a method similar to setSatellite or setTraffic on MapView Thanks José Gil -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Google maps reading data off XML
If you want to display the data on your map you need to parse the xml file and do something with the data. Mind the thread of last week about performance with many objects, though. Stephan -- Interessiert an Android? http://android-schweiz.blogspot.com/ Whant to learn German? http://german-podcast.blogspot.com On 14 Jan., 14:58, Yasin Kothia yasinkot...@gmail.com wrote: Hi, I'm new to android programming, I just finished adding google maps to my App but I needed help Calling An API (http://api.bike-stats.co.uk/service/rest/bikestats?format=[xml ), so that the data from this API would appear on google maps as markers. Any help would be greatly appreciated. Regards -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Version code being displayed instead of Version Name in Samsung Galaxy S - GT I9000 device?
Here is what I get for two phones: phone_model android_version board brand device model product Orange San Francisco2.1-update1 blade ZTE blade Orange San Francisco P729B_ORANGE_CH GT-I90002.2 GT-I9000samsung GT-I9000GT-I9000 GT-I9000 Stephan -- Interessiert an Android? http://android-schweiz.blogspot.com/ Whant to learn German? http://german-podcast.blogspot.com On 17 Jan., 08:00, javame_android su...@softwebsolutions.com wrote: Hi, I do not know what is the reason of this but I just installed one Android app in Samsung Galaxy S - GT I9000 device and its displaying Version code in App info screen. Whereas the Nexus One is displaying the proper Version Name and not Version code. Has anyone faced a similar issue and is there any solution to this? Regards Sunil -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Problem with large number of markers on google map
Guess we read the same tutorial :-) Like TreKing wrote: Remove all those populate calls and pay attention to your draw method. I can handle 7000 objects on a Samsung Galaxy S (but not on slower phones). Greetings from Lucerne, Stephan On 17 Jan., 17:52, TreKing treking...@gmail.com wrote: On Mon, Jan 17, 2011 at 10:43 AM, bobetko bobe...@gmail.com wrote: The thing is, my Nexus One can't handle map with all those markers. It takes around 15 seconds just to draw 500 markers. Then when all drawn, map is not quite smooth. It is sort of hard to zoom and navigate around. It can be done, but experience is bad and I would like to see if something can be done there. First, the code you posted you're calling populate() each time you add a new overlay to your list. That's slow. Add all of you items into the list, THEN call populate ONCE to prepare for drawing. Second, I sincerely hope the code you posted is not what you're doing each draw call. Third, see this thread for a similar discussion:https://groups.google.com/group/android-developers/browse_thread/thre... --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: GPS turned on automatically on some devices?
Thanks for the tipp. I did indeed enableMyLocation and will try your advice. Stephan On 17 Jan., 14:38, Spiral123 cumis...@gmail.com wrote: I seem to remember having a similar problem. Does your Map app display the Users current location at any point? If yes, try calling MyLocationOverlay.enableMyLocation() to start updates in your MapView's onResume() and MyLocationOverlay.disableMyLocation() to stop in the onPause() and see if your GPS problem goes away. On Jan 17, 2:19 am, Stephan Wiesner testexpe...@googlemail.com wrote: Hi, my HTC users keep complaining that i don't turn off the GPS when they exit my Google Maps app. The emulator shows the GPS symbol when I start my app, but none of my test devices do (Samsung Galaxy S, SE Xperia Mini Pro). I don't turn on the gps in the first place. And understood that I am not allowed to do it, even if i wanted to. Here is my code: onCreate: locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); Criteria criteria = new Criteria(); bestProvider = locationManager.getBestProvider(criteria, false); and protected void onPause() { super.onPause(); locationManager.removeUpdates(this); and @Override protected void onResume() { super.onResume(); locationManager.requestLocationUpdates(bestProvider, 1, 10, this); Anybody knows if HTC turns on GPS by default? Greetings from foggy Zurich, Stephan Wiesner -- Interessiert an Android?http://android-schweiz.blogspot.com/ Whant to learn German?http://german-podcast.blogspot.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] GPS turned on automatically on some devices?
Hi, my HTC users keep complaining that i don't turn off the GPS when they exit my Google Maps app. The emulator shows the GPS symbol when I start my app, but none of my test devices do (Samsung Galaxy S, SE Xperia Mini Pro). I don't turn on the gps in the first place. And understood that I am not allowed to do it, even if i wanted to. Here is my code: onCreate: locationManager = (LocationManager) getSystemService(LOCATION_SERVICE); Criteria criteria = new Criteria(); bestProvider = locationManager.getBestProvider(criteria, false); and protected void onPause() { super.onPause(); locationManager.removeUpdates(this); and @Override protected void onResume() { super.onResume(); locationManager.requestLocationUpdates(bestProvider, 1, 10, this); Anybody knows if HTC turns on GPS by default? Greetings from foggy Zurich, Stephan Wiesner -- Interessiert an Android? http://android-schweiz.blogspot.com/ Whant to learn German? http://german-podcast.blogspot.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Performance issue with mapview when using large number of items
Thanks for your reply. I have thought about that, but can't find a good solution for that either. Sure, nobody needs them all at zoomed out level. But the user needs to see that there are at least some at a location (like I said, whole country). So I would have to, don't know, show only one in ten or something like that. They are clustered in the mountains and far between in other areas. Meaning I would have to calculate, what? The distance between all points? How would I decide which to display and which not to display? The problem gets even more complicated, as there are even some points in other countries all over the world (very few but increasing with use), so the users DO zoom in and out a lot. Thats why they need to see in which countries/areas there are some points. Hmh... But you are right, if I want to grow my app there has to be a way to decide which points to display if there is a performance penalty for each point. Stephan On 13 Jan., 16:28, TreKing treking...@gmail.com wrote: On Thu, Jan 13, 2011 at 1:10 AM, Stephan Wiesner testexpe...@googlemail.com wrote: Any hints? Don't show 7,000 items. Seriously, what user needs to see or interact with 7,000 items, particularly at a zoomed out level where most probably overlap anyway? --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Performance issue with mapview when using large number of items
seems to be a versatilbe body part you have there :-) Thanks for the input. Stephan On 13 Jan., 18:10, TreKing treking...@gmail.com wrote: On Thu, Jan 13, 2011 at 10:38 AM, Stephan Wiesner testexpe...@googlemail.com wrote: Thanks for your reply. I have thought about that, but can't find a good solution for that either. Sure, nobody needs them all at zoomed out level. But the user needs to see that there are at least some at a location (like I said, whole country). So I would have to, don't know, show only one in ten or something like that. They are clustered in the mountains and far between in other areas. Meaning I would have to calculate, what? The distance between all points? How would I decide which to display and which not to display? As MrChaz alluded to, you'll want to cluster your points at zoomed out levels. One dumb implementation could, for each zoom level, define a Cluster which is a collection of markers. You'll have a set of Clusters and a pivot point in each cluster to compare to. For each of your markers, iterate over you set of clusters. For each cluster compare the market against the pivot . If it's close enough (in screen terms) you add it to that pivot's cluster, otherwise it starts it's own cluster and becomes the pivot of that cluster. Once you're done you'll have a set of clusters for each zoom level and that's all you'll have to display, either based on the pivot or the average location of all markers in the cluster. You can cache this data structure so you don't have to rebuild it each time and perhaps only load the cluster set for a given zoom level when the user zooms to that level. I just pulled that out of my ass so no idea how practical it actually is, but should give you some idea on how to proceed =). --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Performance issue with mapview when using large number of items
Now, thats an interesting idea. I will look into the bitmaps right away. I did check a lot of performance checking and tuning loading and creting my objects, thats smooth by now. I am not very experienced with the drawing part, though. Like you pointed out, the drawing is propably too expensive/done too often. Most of the time, the map just sits there after all... Thanks and tired greetings from Bern, Stephan On 14 Jan., 00:45, Bob Kerns r...@acm.org wrote: A couple things MrChaz and TreKing didn't touch on. First, I'd make certain you're not doing something to cause the draw method to be called 7000 times! Second, I'd make sure you're not doing something horribly expensive in there -- perhaps something allocating a lot of memory and triggering the GC. That's probably not your issue, but capturing some timings on the drawing calls is probably worth your while anyway. Third, and probably most important -- rather than drawing 7000 items on each draw call -- draw the 7000 items into a bitmap, and draw that bitmap, translated and scaled appropriately. When you get off the edge of the bitmap, redo it for the new position and/or scale. Make it big enough to allow for smooth scrolling in the immediate vicinity. You can draw your 7000 items with a degree of transparency, so they overlap and add up density. That's not the ideal way to show clustering, but it's a start. A more sophisticated approach would be to draw into a grayscale bitmap with a density distribution image, and use the resulting density bitmap to index a color map. Or if you prefer iconified clustering, rather than visual illustration of the clustering: wherever the density is over a threshold, find the centroid of that area, integrate the total score for that area, and draw an icon of that diameter. On Jan 12, 11:10 pm, Stephan Wiesner testexpe...@googlemail.com wrote: Hi, my app is supposed to display about 7000 items on a mapview (distributed over a whole country), but I have serious performance issues with this. Currently I only display the items that are in an 15km radius of the center of the map (user has to press a button for this) and everything works fine. I would prefer to show all items at start, though. That is possible, but moving the map around becomes very slow (guess I need that new LG phone after all :-). I extend ItemizedOverlay and the problem seems to be in public void draw(Canvas canvas, MapView mapView, boolean shadow) { if (canvas != null mapView != null) { super.draw(canvas, mapView, false); } } if I comment out the call to super, the moving of the map is smooth (but of course nothing is displayed). Any hints? Thanks, Stephan -- Interessiert an Android?http://android-schweiz.blogspot.com/ Whant to learn German?http://german-podcast.blogspot.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Performance issue with mapview when using large number of items
Hi, my app is supposed to display about 7000 items on a mapview (distributed over a whole country), but I have serious performance issues with this. Currently I only display the items that are in an 15km radius of the center of the map (user has to press a button for this) and everything works fine. I would prefer to show all items at start, though. That is possible, but moving the map around becomes very slow (guess I need that new LG phone after all :-). I extend ItemizedOverlay and the problem seems to be in public void draw(Canvas canvas, MapView mapView, boolean shadow) { if (canvas != null mapView != null) { super.draw(canvas, mapView, false); } } if I comment out the call to super, the moving of the map is smooth (but of course nothing is displayed). Any hints? Thanks, Stephan -- Interessiert an Android? http://android-schweiz.blogspot.com/ Whant to learn German? http://german-podcast.blogspot.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to investigate a system crash reported by user?
Try http://code.google.com/p/acra If there is a normal exception it should be reported. Greetings from Zurich, Stephan On 11 Jan., 15:39, Mark Carter mjc1...@googlemail.com wrote: A user has reported that running my paid app (interestingly the free version runs fine using almost the same codebase - LVL being the biggest difference) immediately results in a Force Close and then he cannot do anything other than switch off the device (Galaxy S running official ROM). If he hold down the home key he ends up at the homescreen and all the icons have disappeared (and the Menu is inaccessible). Usually, I ask the user to use something like aLogCat to send me the logs but that's not possible in this case. Any other suggestions on how to investigate this remotely? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to exit the application..?
It comes back to designing Apps that do not need to be stopped. Let me guess, you do not own a Samsung Galaxy S I9000? I was constantly switching to the taskmanager trying to kill processes, uninstalling all apps that ran in the background, etc until the 2.2.1 patch. . . Android might kill a process/app sooner or later, but I don't want to lag-wait on a 600$ phone. The Galaxy is (was) ver slow when a few apps ran. And it is the phone that most of my users own. Sorry, had to let that out :-) Greetings from Lucerne, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] When is an app movable to sd card?
Hi, what do I have to do in order for my app to be movable to sdcard? App2SD for example lists my app as not movable. Thanks and greetings from Zurich, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: When is an app movable to sd card?
Super, thanks :-) Stephan On 7 Jan., 12:11, YuviDroid yuvidr...@gmail.com wrote: These docs are helpful:http://developer.android.com/guide/appendix/install-location.html On Fri, Jan 7, 2011 at 11:59 AM, Stephan Wiesner testexpe...@googlemail.com wrote: Hi, what do I have to do in order for my app to be movable to sdcard? App2SD for example lists my app as not movable. Thanks and greetings from Zurich, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- YuviDroid Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget to quickly access your favorite apps and contacts!)http://android.yuvalsharon.net -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: webview show map problem?help me
What is your error? Greetings from lucerne, Stephan On 5 Jan., 00:20, CaryWang wangjf...@gmail.com wrote: I try webview show map,but is error. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); startButton=(Button)findViewById(R.id.start); startButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Uri uri = Uri.parse(geo:38.899533,-77.036476); Intent it = new Intent(Intent.ACTION_VIEW, uri); it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(it); } }); } -- Cary -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: GPS MapView: animate to current position
Solved it: I have set different criteria: Criteria criteria = new Criteria(); //criteria.setAccuracy(Criteria.ACCURACY_FINE); // more criteria If I remove those, the code works fine. . . Stephan 2010/12/31 Stephan Wiesner testexpe...@googlemail.com Hi, I have a MapActivity, using Google Maps and need to center that map on my current position. The map is displayed correctly and I can even mark my current location with MyLocationOverlay here = new MyLocationOverlay(this, mapView); here.enableCompass(); // compass is displayed here.enableMyLocation(); // blue circle is displayed correctly mapOverlays.add(here); GeoPoint p = here.getMyLocation(); // p is null ??? if (p != null) mapController.animateTo(p); If the blue circle marks my position correctly, how do I get this position so that I can animate there? thanks, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to read file from assets dir?
Hi, I want to read a txt file that is deployed with my application. The file is in the assets directory and I try to read it with: String url = file:///android_asset/text.txt; InputStream instream = openFileInput(url); This results however in: 12-31 07:05:46.638: DEBUG/GMAP(14396): Read error:java.lang.IllegalArgumentException: File file:///android_asset/text.txt contains a path separator So, where should I put the file or how should I read it? Thanks, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to read file from assets dir?
thanks :-) 2010/12/31 Dianne Hackborn hack...@android.com API demo here: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/content/ReadAsset.html On Thu, Dec 30, 2010 at 10:09 PM, Stephan Wiesner testexpe...@googlemail.com wrote: Hi, I want to read a txt file that is deployed with my application. The file is in the assets directory and I try to read it with: String url = file:///android_asset/text.txt; InputStream instream = openFileInput(url); This results however in: 12-31 07:05:46.638: DEBUG/GMAP(14396): Read error:java.lang.IllegalArgumentException: File file:///android_asset/text.txt contains a path separator So, where should I put the file or how should I read it? Thanks, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] GPS MapView: animate to current position
Hi, I have a MapActivity, using Google Maps and need to center that map on my current position. The map is displayed correctly and I can even mark my current location with MyLocationOverlay here = new MyLocationOverlay(this, mapView); here.enableCompass(); // compass is displayed here.enableMyLocation(); // blue circle is displayed correctly mapOverlays.add(here); GeoPoint p = here.getMyLocation(); // p is null ??? if (p != null) mapController.animateTo(p); If the blue circle marks my position correctly, how do I get this position so that I can animate there? thanks, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to display HTML formatted text in a TextView contained in a ListView
Hi, I try to display HTML formatted text in a TextView contained in a ListView and can't get any formatting displayed. Linebreaks are displayed correctly, so the HTML formating is executed (at least to some extend). I download the text from the web and it contains br-tags (which are displayed correctly) and simple tags like b and i. I also tried things like small, etc, which I found on different Android tutorials. Any way to get some formatting (sizes, colors, anything) into my TextView? ListString titles = new ArrayListString(messages.size()); *Spanned text = Html.fromHtml(text);* titles.add(text.toString()); ArrayAdapterString adapter = new ArrayAdapterString(this, R.layout.row, titles); ListView list = (ListView) findViewById(R.id.list); list.setAdapter(adapter); My TextView: TextView xmlns:android=http://schemas.android.com/apk/res/android; android:id=@+id/TextView01 android:layout_width=wrap_content android:layout_height=wrap_content android:textSize=@dimen/text_size android:text=temp / Thanks, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to display HTML formatted text in a TextView contained in a ListView
A, thanks a lot. That was a quick fix :-) Happy greetings from Lucerne, Stephan On 23 Dez., 17:48, Kostya Vasilyev kmans...@gmail.com wrote: 23.12.2010 19:10, Stephan Wiesner ?: *Spanned text = Html.fromHtml(text);* titles.add(text.toString()); Take out the second line (toString), and carry the result of Html.fromHtml as a CharSequence (or Spanned) all the way to TextView.setText. What this code does is first parses the HTML and creates markup (behind the Spanned object), and then throws the markup away in a conversion toString(). -- Kostya Vasilyev -- WiFi Manager + pretty widget --http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: where is my data?
thanks for the fast reply. only thing is: getFilesDir() returns /data/data/de.stephanwiesner and, like i wrote, that dir does not exist (or is not accessible) Furthermore I read in Sams Teach Yourself Android that the data should be in /data/data/package name And, I am sure that it was there last week. I have copied my database file several times to my PC for further processing and can't do that anymore, as I don't find it :-() My phone was never rooted. Stephan On 21 Dez., 10:09, Mark Murphy mmur...@commonsware.com wrote: You cannot access /data from DDMS on most, if not all, non-rooted Android devices. Your application data will be stored wherever getFilesDir() says it will be stored. On Tue, Dec 21, 2010 at 2:50 AM, Stephan Wiesner testexpe...@googlemail.com wrote: Hi, after updateing my Samsung Galaxy i9000 to the latest patch (still running Android 2.1) I can not find the data of my apps anymore. They used to be in /data/data/package name Now there is no such directory anymore. /data is empty. I tried to find it using DDMS in Eclipse and ASTRO app on the phone, but can't find it. Any tipps? Thanks, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: where is my data?
Yes, I can read my data. Frankly I just wanted to copy my database via eclipse ddms to my PC for analysis. Guess I will have to mail it or something .-) Thanks, Stephan 2010/12/21 YuviDroid yuvidr...@gmail.com: Still, you can access that directory through your app. Try writing and reading a file there and it should work fine. On Tue, Dec 21, 2010 at 10:37 AM, Mark Murphy mmur...@commonsware.com wrote: On Tue, Dec 21, 2010 at 4:34 AM, Stephan Wiesner testexpe...@googlemail.com wrote: thanks for the fast reply. only thing is: getFilesDir() returns /data/data/de.stephanwiesner and, like i wrote, that dir does not exist (or is not accessible) It is not accessible from DDMS, nor from ASTRO. It is not supposed to be. And, I am sure that it was there last week. I have copied my database file several times to my PC for further processing and can't do that anymore, as I don't find it :-() My phone was never rooted. Then there was a flaw in the original firmware that has since been corrected. What you are experiencing is the normal state of affairs for Android development -- you can access your app's local files on an emulator, or possibly on rooted phones (not sure about that), but not on regular hardware. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- YuviDroid Check out Launch-X (a widget to quickly access your favorite apps and contacts!) http://android.yuvalsharon.net -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: where is my data?
ähm, actually, i do not have an (external) SD Card. The phone has 8 GB on its own, so no need for a card. Its actually very interesting to see how many apps don't work without a card .-) Writing to the internal card would be great, though. Did not think of that and I will try that right away. I just wrote a PHP script I can send my data to and that forwards it to, ähm, it works, but might be a little overkill... Stephan 2010/12/21 Sarwar Erfan erfanonl...@gmail.com: If you can read it from app, why dont you just copy it to sdcard by writing some lines of codes in your app? Then you can get it to your pc from sdcard. Regards Sarwar Erfan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] where is my data?
Hi, after updateing my Samsung Galaxy i9000 to the latest patch (still running Android 2.1) I can not find the data of my apps anymore. They used to be in /data/data/package name Now there is no such directory anymore. /data is empty. I tried to find it using DDMS in Eclipse and ASTRO app on the phone, but can't find it. Any tipps? Thanks, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to include line break in notification?
Hi, i want to include line breaks in the long text of notifications. \n does not work. I want to display my information in 2 blocks and need a visual distinction between these blocks. notification.setLatestEventInfo(context, expandedTitle, longText, launchIntent); Thanks, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Facebook connect works in Emulator but not on Mobile
Hi, i have downloaded the facbook sdk from github and the sample code works for me - on the emulator. The same code does not work on my Samsung Galaxy i9000, though. I get a key error. I use a key genereated by adding an application to Facebook, as described in the facebook sdk. I have not modifide the examples in any way, excep changing the key to my own. Any ideas? Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to deploy and display images in App
Hi, i have a little app that just displays a number of pictures and texts (think quizz). I can load the text and filenames from an XML file and display them as text. And I can display pictures from a webpage (using ImageSwitcher) if I provide the full URL as a filename. This requires an internetconnection, though and my app is supposed to work offline. What I don't manage to do is: - load pictures that are stored locally as part of my app (e.g. in the drawable folder) - where in my app would i ideally put those files? please help me out with a code example. Thanks and greetings from Lucerne, Stephan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en