Android : How To Deal With BuiltInZoomControl With Custom In Droid Google Map
Dec 12, 2009
I am trying to develop a Android Google Map application, which is basically Gmap with my own marker geo layer. Since android.com is banned in China, I have to search support from Google user groups. I have no idea which groups I should call for help, android group or google map group. Anyway here is my questions:
I am working on Android SDk1.5. I want to reproduce the floating buttons presented in android Google map, which stands for three buttons: ZoomControl (left), FocusChange (middle), and ListControl (right). (Pls check ref1. ) I checked some open source projects, if designer can place these controls in the layout.xml with relative layout, to place them over (on the top of) the mapview. It may solve some problem, however in the SDK1.5' add-on gmap jar, the getZoomControl is discarded. I can only setBuiltInZoomControl(true) to enable the builtin zoomcontrol. By default, the "BuiltIn" Zoom Control is placed at Bottom/Center. (Pls check ref 2.) I have no idea how to relocate the "BuiltIn" Zoom Control to the left as native GMAP does.
So: How to relocate the BuiltIn Zoom Control ? How to add addtional custom control (buttons/overlays) with BuiltInZoomControl ? What functions should be overriden for the detail implementaiton, Such as synhcorization with the visibility? I am appreciated if the answer can be offered with code snippet or references to any internet site.
Ref: 1) http://www.ennovation.org/pix/transit-android-google-maps.png 2) http://www.ennovation.org/pix/device005.png
View 2 Replies
Apr 23, 2010
I am learning how to program on Android phone. However I am unsure how to make my application work for the different screen sizes and resolutions.
I read the tutorial on the android site and still unsure how to do it.
First I know there are different files so could make a layout for each of the sizes but my problem is most of the screen needs to be dynamically created so there would not be much to put in these files.
So I am not sure how to android to re size dynamic controls based on the screen size.
I have also read it is bad practice to make controls in anything but the xml file as it separates view logic and programming logic. However they never talk about if you need to make these controls dynamically what you should do.
So is there some other way to do it that is considered good practice?
Edit
I get this error when I try to run the switcher application.
[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: Error type 2
[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: Error: Unable to connect to activity manager; is the system running?
[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: usage: am [start|broadcast|instrument|profile]
[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: am start [-D] INTENT
[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: am broadcast INTENT
[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: am instrument [-r] [-e <ARG_NAME> <ARG_VALUE>] [-p <PROF_FILE>]
[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: [-w] <COMPONENT>
[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: am profile <PROCESS> [start <PROF_FILE>|stop]
[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: INTENT is described with:
[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: [-a <ACTION>] [-d <DATA_URI>] [-t <MIME_TYPE>]
[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: [-c <CATEGORY> [-c <CATEGORY>] ...]
[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: [-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> ...]
[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: [--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...]
[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: [-e|--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...]
[2010-04-27 12:06:41 - ViewSwitcherTest] ActivityManager: [-n <COMPONENT>] [-f <FLAGS>] [<URI>]
To your question: It's dynamic because
the buttons in my example grow and
shrink depending on one of the 3
possibles sizes, because they use
scaled pixel (You probably know that
you don't have to deal with screen
sizes itself). So a scaled pixel
compared to a real a pixel has a size
of 0.75px, 1.0px or 1.5px. Android
automatically and dynamically adjusts
it to the actual size. So you don't
have to care about this in your code.
So if I use scaled pixels then I don't have to worry about different screen sizes?
At the moment I don't know an example
except in games where you have to deal
with "real" pixel. But if you want use
it, multiply it with the value of the
current density. This is your "ratio".
I don't have the example with the ball
anymore but I have another which uses
the same technics. You can run it on
different screen sizes and you will
see that the buttons will always fit
into the layout. You could use the
same technics for your intents. In
this example you can scroll with the
"Scrn" buttons from one view to
another of 4 views. (At the moment
they all have a black background so
you don't see that they are different
views). The "Enter" button exits the
test. It's an Eclipse project. You can
download
So if I want to deal with ratio then I use real pixels and not scaled pixels? What advantage does this give me?
will scaled pixels work with changing from portrait to landscape( ie will it fill up the new found space)?
Finally should I make the controls now through code or is there another way? As I said I am getting data from a webservice that must look like this
checkbox label label
It can be one record or 10,000 records I don't know so these have to be appended to something that is like a window panel( the controls in there get a scroll bar).
View 3 Replies
View Related
Jul 25, 2010
I'm all new to this android stuff and i was wondering what the big deal of root is? like what can you do with root that you cant do before? Please don't comment if you have something bad to say as you were too once as new as me.
View 3 Replies
View Related
Feb 5, 2010
What's the deal with the Flickr integration?I thought I would transition over from Photobucket because it looked like it might make it easier to access and share photos.So I find out that I need a YahooID to sign up for Flickr.Why not something with Google (Picasa)?
View 2 Replies
View Related
Apr 10, 2010
First of all, I'm a very happy Eris user. I've had the phone since January and have just decided to "put up with" the fact the vibration is too weak. But its starting to get rediculous. I miss calls, texts and emails constantly with this phone! And just yesterday, my Boss actually made a comment to me about it (something like "you need to start answering you damn phone!"). I had a BB for 5 years leading up to my getting the Eris in January and rarely missed a call or message.
I have Smart Vibrate loaded and have programmed distinct patterns, but it's not helping. If somebody doesn't have a good idea or remedy for this, I might be forced to go back to BB.
I've read posts like this before and everybody just seems to deal with this, but please tell me somebody has a trick they can share
View 18 Replies
View Related
Jun 11, 2010
About the Eris. On version 2.1 does Beautiful Widgets (the app) show under "data" on your SD card? Should it? If it doesn't belong there should and I delete BW - will the clock/weather on the home screen still work? I expect the HTC / Android clock weather deal is a widget vs an app? Or is it an app and what is it called?'
View 6 Replies
View Related
Aug 15, 2010
holy cow, since 2.2, my battery drains in like 4 hours. even in standby. is there some setting i should turn off? whats the deal?
View 9 Replies
View Related
Nov 29, 2010
No calDav support (and no, the free app Calendar syncing does not work with my company's iCal server) is a deal breaker for me, unless one of you guys can point me in the right direction, my iPhone 4 will have to come out of the drawer.
View 3 Replies
View Related
Apr 23, 2010
I currently running Smoked Glass V6.0.1. I tried updated my google maps to 4.1.1 and I get a invalid signature. According to google mobile help forums I am receiving this error because my build number doesn't match specific build numbers their application is designed to work with.
Has anyone else experience this problem?
View 8 Replies
View Related
May 2, 2010
Are there any custom Google search bars that you can install on your phone instead of the plain white search bar?
View 1 Replies
View Related
Oct 13, 2009
I am essentially using a listview but am looking at providing a bookmark functionality. I am thinking that I should store the item attributes in a file when bookmarked and retrieve when required to populate a bookmark listview.
I was wondering if there is a de facto standard used in achieving this or do I follow just the "writing into a file" and "reading from a file" when necessary style?
View 1 Replies
View Related
Feb 8, 2010
We want to add below update sql into our content provider:We found current update of content provider does not support it, which would not recognize the "column1" of "column1 + 1" as column name. So we have to add execSQL method into ContentProvider and I think it is dirt. So I wonder if anyone know how to do such thing with ContentProvider or any more elegant way to achieve it.
View 5 Replies
View Related
Dec 10, 2009
My application needs to intensively manipulate (read-write) on some structured text data.The size of the data is significant 1Mb. And there is initial data available for the user to start with.My idea is to put this data as a file in the .apk. Then, on initial application launch to read this data and populate Android SQLite database with it. Then just work with this database. But after the database is populated the data file is no longer needed. And I'd like to remove it to free some memory. Alternate approach is to work with this data file instead of SQLite database. But I assume SQLite would work a magnitude faster then i/o on my data file..
View 16 Replies
View Related
Nov 5, 2010
Does anyone tried to use CursorAdapter with old and new api?
Do you have some code examples of such solutions?
View 1 Replies
View Related
Jul 11, 2010
I write a listactivty,the item including a textview and a button,the data came from a sqlite。but in handling the clickevent , i meet some problem, in the CursorAdapter's bindView() function,i cann't get the current position。in log,i find position of Cursor is the position I last click the item of listview.
The code as follows: package miaozl.hello;
CODE:............................
View 5 Replies
View Related
Apr 24, 2009
I want to create an app widget that could take up a different number of "cells" on the home screen, but I don't think that the app widget framework easily supports this. I know that an app widget can have a configuration screen, and I'd like the user to be able select a sort of small, medium, or large size for the widget as part of my configuration activity. Unfortunately, I don't think that this is possible, correct? Based on the minWidth and minHeight properties, the Launcher app will assign a number of cells that I can't configure at run time.
For instance, if I want a weather widget that has a current, hourly and weekly format that take up 1, 2, and 4 cells respectively, I can't do this at run time. Instead, I believe my only option is to export 3 different widgets and have them all listed in the widget picker dialog as something like "Weather - current conditions", "Weather - hourly forcast", and "Weather - week long forcast".
View 2 Replies
View Related
Jun 24, 2010
I've got a query, (I'm using rawQuery())
SELECT * FROM <table>
I'm then storing what it returns using a cursor. From their what I want to do is, start at the first row so.. cursor.moveToFirst() then take each column , column by column and store its particular value in a variable. I then want to move onto the next row and do the same. So I guess my question is How would I get cursor to deal with multiple columns?
View 2 Replies
View Related
Oct 30, 2011
I've been looking around a bit but didn't find exactly what I'm looking for. I would like to apply a custom skin instead of the default Google Map api on an Android app.
Is there any trivial way to do this? For example, swapping the colors of the streets from yellow to another color?
An example could be the way the game Life is Crime has its custom skin on the regular Google map.
[URL]
Another example, not Android related is this one:
Google Maps API Styled Map Wizard
View 2 Replies
View Related
Jul 21, 2010
What is the deal with sprint navigation.I close the app and 10 minutes later i check my atk and it's open again like a pesky little fly.Is there a way to shut the app down without deleting it and open it when needed?
View 1 Replies
View Related
Apr 10, 2010
I see that people here have walked out of mobile phone stores with some great bargains. I've been living off my wife's old contract phones for years and I always hated going into stores to look at phone as sales people always tried to sell me stuff I didn't want / need. I've now decided it's time to invest in a Desire with a contract (T-Mobile). Their �10 a month for 100 mins & txt (phone �164) is tempting but I probably prefer 600 mins & unlimited text for �21.35 (after redemption) from buymobilephones.net How's the best way to approach a sales person in a store bearing in mind that I'm a new customer? Are they fairly flexible when it comes to discussing contracts? I just fancy walking in and asking if they can match a certain contract deal on the internet!?
View 2 Replies
View Related
Jul 22, 2010
I created a custom map in Google Maps "My Maps". Now i want to show that map on an android device, but not just opening it as a web page but showing it using MapView or smth similar. I want to be able to center on a place I have marked on the map etc. My custom map is a map containing the location of all gas stations in a city.
View 1 Replies
View Related
Jul 14, 2010
I am new to Android and so I may be missing some very basic things here. I am trying to host custom KML files on a server behind my firewall and display those KML files on the Android emulator. I started by writing a simple app that uses an Intent to display the overlay and pointing the app at geo:0,0?q=
http://code.google.com/apis/kml/documentation/KML_Samples.kml. This works in the emulator.
Next I downloaded that KML file and posted it on my web server (Apache 2.2 on Fedora). I added an AddType directive for the .kml extension and restarted HTTPD. When I point my simple app's Intent to my internally hosted KML file I get the error "The community map could not be displayed because it contains errors." I added some code to try and download the KML file independently of the KML so I could check the status line and the like:
final HttpClient client = new DefaultHttpClient();
final HttpGet get = new HttpGet("http://mycompany.com/data/KML_Samples.kml");
try { final HttpResponse resp = client.execute(get);
android.util.Log.e("MapOverlays", resp.toString());
} catch (Throwable t) {
android.util.Log.e("MapOverlays", "Exception", t);
}
With a breakpoint on the first Log message line I can inspect the results:
statusline = "HTTP/1.1 200 OK"
Content-Type: application/vnd.google-earth.kml+xml
Here's the Intent I'm using:
final Intent intent = new Intent(
android.content.Intent.ACTION_VIEW,
Uri.parse("geo:0,0?q=http://mycompany.com/data/KML_Samples.kml"));
startActivity(intent);
So the two main questions are
What do I need to do to get KML loaded from a private server?
What tools are available (if any) to determine what is wrong with what I've done (something more informative than "The community map...")?
View 1 Replies
View Related
May 27, 2010
Going from hero->evo means my mini usb cords are useless. I'm looking around but can't seem to find anyone selling a bundle of maybe 4-5 cords, they seem to all be selling individually along with car/wall chargers (which i won't need)
View 5 Replies
View Related
Aug 1, 2009
I have been looking for a good deal on the Hero. I found the website mobilephonesdirect.co.uk, and they are offering the Hero at �25 for 24 months on Vodafone with 100 mins and 500 txts and unlimited internet. The phone is free and it looks like a great deal. Does anyone have any experience of comments on dealing with these guys?
View 20 Replies
View Related
Jun 7, 2010
I have these on my Blackberry and they are as good as any other Invisable Shield type protector at about half the cost. Glad to see they now have them for EVO.INVISIBLE HTC Evo 4G CLEAR Full Body Screen PROTECTOR - eBay (item 370390797766 end time Jul-02-10 16:28:11 PDT)
View 5 Replies
View Related
Jul 14, 2010
Just wondering...well first i should ask, what exactly is is mobi tv? is it like sprint tv? and would it come free of charge with the vibrant, like the sprint tv comes with the htc evo 4g?
View 14 Replies
View Related
Aug 12, 2010
I was wondering how people navigate with multiple destinations. It seems that Google Navigation doesn't nativity support it. Ultimately, I want to take a route different than the default quickest route to avoid an intersection, and on other GPS's, I would add the detour as a way-point. If this feature isn't available, has anybody found a workaround?
View 7 Replies
View Related
Nov 4, 2010
I've been stuck for ages now trying to implement threading or background image loading for a custom tile overlay class I've been working on. I'm pretty useless when it comes to Java so threading isn't something I've had any experience with. Basically I have extended an ItemizedOverlay and in the draw() method calculate the tiles I need to display over the standard google tiles then fetch those images with a URLConnection and using BitmapFactory decode them and draw them to the canvas at the correct position on the screen so that the images are on top of the google tiles with about 50% opacity (the custom tiles are cellphone network coverage png's which are used for our web app). I initially got this all working with the tiles loading in the correct places but hit issues with memory and "freezing" while panning so implemented some basic caching and memory management to only store the tiles that are displayed on the map in memory and when downloading a tile store it to SD card.
Then I figured the freezing while panning is due to the blocking nature of downloading the images so, have been trying to implement threading. I created a class that extends AsyncTask to download the images in the background and store them to SD, in the onPostExecute method I then try to draw all the tiles. But onPostExecute never seems to fire, now I know that the AsyncTask has to be called in the main ui thread so tried to debug the execution with Thread.currentThread().getId() calls through out the code. The thread Ids through out is 1 and then 10 for the doInBackground method for the AsyncTask. Now I'm not sure if 1 is the main UI thread or not. In the extended MapActivity class I have, the onCreate method's Thread.currentThread().getId() returns 1 but I'm not sure if the MapActivity class is executed in the main ui thread? Here Romain Guy mentions that the onPostExecute method should have @Override but when I do that eclipse flags it as an error
"The method onPostExecute(Boolean...) of type TileCache.ImageLoadTask must override or implement a supertype method"
So I guess something is wrong there but the only fix eclipse offers is to remove the @Override
So I guess with out post all my source code, the question's I have are:
Is the MapActivity onCreate method called in the main ui thread?
What does the @Override error mean? or why does it show that error
Does anyone have an example of a custom tile overlay implementation with background image loading and tile caching?
View 1 Replies
View Related
Apr 14, 2010
I thought I would post something on how to get a good deal to help you people looking for one. The way I did it was find an offer on teh interwebs > Sony-ericsson X10 deals with Orange (I had to dig quite a lot and go through advanced search and select the free gift as free delivery) This is a good deal but I couldn't be bothered going through the whole thing of switching provider so...
View 6 Replies
View Related
May 5, 2010
Generally music setup is good, much better than on the Blackberry. However, when I go into the album folder all the songs show up from that album as individual albums; on some of them when I click, it will show about 3 songs, others 1 etc. Also, showing 3 of the same song, not sure how that occurred but can probably fix that.
View 7 Replies
View Related