Basic4android Share Your CreationsShow your creations. Please upload source code if possible. You can use File - Export As Zip to create the zip file.
The first attached image will be displayed as the thread preview image.
Here is a GPS Example program with following functions:
Connect the GPS
Get and display GPS information
Save a GPS path (program internal GPP format and Google Earth KML format)
Display the available satellites
Display Google maps
Display a GPS path on the map
Google map functions, user settable :
Display zoom control
Display scale control
Display a path
Display markers
Move a marker
Display coordinates (touch the screen)
Move the map / Display coordinates (touch the screen and move)
Some special features:
Table with first column always visible. Image GPS_3.
Touching a button changes it's color and shows a tooltip on top of the screen. Releasing it insides the button area executes the function and hides the tooltip. Releasing outsides the butoon area does not execute the function and hides the tooltip. This allows to check a button function without executing it. Image GPS_4
Touching some buttons displays 'subbuttons' to select other setup parameters more easily rather than doing it in the setup screen. Image GPS_5
Comments on the images:
GPS_1 Display of a GPS path with polyline and markers
GPS_2 Display of current GPS data with the position on the map
GPS_3 Display of GPS path data in a table
GPS_4 Main screen, display of a tooltip, just touched the PATH button before releasing it
GPS_5 Display of 'subbuttons' to select setup parameters
GPS_6 Display og Satellites data
GPS_7 Setup screen
GPS_8 Save screen with one button foe each file format
It is designed for smartphones and does work only in portrait mode.
The program needs following additional libraries:
- ByteConverter
- Dialogs
- RandomAccessFile
- WebViewExtras
Thank's to warwound for the WebViewExtras library, that allowed adding events to the GoogleMaps WebView.
The programs functionalities are explained in the Basic4Android User's Guide and some code is also explained.
If there are some code parts you would like having explained in the Basic4Android User's Guide post the request in this thread.
Best regards.
EDIT: 2011.12.20 version 1.1
Updated the source code after the bug reports.
EDIT: 2011.12.21 version 1.2
Added the maptype_changed event, problem reported by dlfallen in post#21
EDIT: 2011.12.22 version 1.3
Changed the zoom calculation
Added MapTypeControlID choice
Added MapZoomControlStyle choice
EDIT: 2011.12.23 version 1.4
Amended the problems reported by dlfallen
EDIT: 2011.12.27 version 1.5
Added saving of a GPS path in Google Earth KML format.
Removed the short help file, the help is in the Beginner's Guide.
EDIT: 2011.12.28 version 1.51
Amended bug reported by timo in post #37
EDIT: 2012.02.06 version 1.55
Amended bug report by msains in post #56
EDIT: 2012.02.06 version 1.56
Amended bug report by alfcen in post #59
EDIT: 2012.02.08 version 1.60
Amended bug report by Andras in post #64
Despite being YOU the Birthday boy, it's US who get the present!!! Thanks!!!!
I have one request:
Is it possible to draw a "Navigator" like path, from the actual device position to a marker?
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
My Posts helped you? Consider Buying me a Porto Glass!
Is it possible to draw a "Navigator" like path, from the actual device position to a marker?
I'm afraid no, it could be possible to draw a straight line from the current point to a marker, but as I don't know any vertice of the roads I can't draw a Navigator path.
Am I right to think tha the Google Navigator uses the same engine as the Google Maps?
If so, would it be possible to replace the "google maps" portion of the app with the navigator one?...
Hope I am being clear enought...
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
My Posts helped you? Consider Buying me a Porto Glass!
Just found a very interesting page regarding the Directions API within the main MAPS API...
I believe that making a Library to simplify the most frequent/usefull functions of these API would be a HUGE task...
Anyone up to the challenge??
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
My Posts helped you? Consider Buying me a Porto Glass!
Klaus, you may have noticed that in a recent update to my GPSlog program, I added mapping for the current location and for stored locations. I found an unexpected difference in behavior between the program running on my Motorola Droid 2, and my Acer Iconia a500 tablet. On the phone, the zoom control is displayed as expected, but on the tablet the zoom control is missing. I loaded your GPS example on both of my devices, enabled the zoom control on both, and tested it. I got the same result: no zoom control on the tablet. Any ideas why this is?
Another small problem with your example program is that I also enabled the map type control, and on the phone the Altitude label sits on top of the type control, making that control difficult to read.
Another strange behavior is this. On both devices (phone and tablet) with the zoom and map type controls enabled, the initial map view when switched to satellite view is at the default zoom level. When I click on the setup icon, change nothing, click back on the map icon the display is at maximum zoom.
The last two items should be easy to fix, but the missing zoom control on the table has be stumped at the moment.