Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
0.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Bokhorst committed Feb 11, 2012
1 parent 70b1439 commit 2b07ac3
Show file tree
Hide file tree
Showing 25 changed files with 353 additions and 230 deletions.
3 changes: 2 additions & 1 deletion .classpath
Expand Up @@ -3,5 +3,6 @@
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/> <classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath> </classpath>
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
bin/ bin/
gen/ gen/
.settings
3 changes: 2 additions & 1 deletion AndroidManifest.xml
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="biz.bokhorst" android:versionCode="3" android:versionName="0.3"> package="biz.bokhorst" android:versionCode="4" android:versionName="0.4">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-sdk android:minSdkVersion="7" /> <uses-sdk android:minSdkVersion="7" />


<application android:icon="@drawable/icon" android:label="@string/app_name"> <application android:icon="@drawable/icon" android:label="@string/app_name">
Expand Down
6 changes: 5 additions & 1 deletion README.md
Expand Up @@ -70,6 +70,10 @@ Other application options:
* Min. accuracy: tracking will stop after this accuracy has been reached (default 20 meters) * Min. accuracy: tracking will stop after this accuracy has been reached (default 20 meters)
* Geocode count: the number of addresses to show when reverse geocoding (default 5 addresses) * Geocode count: the number of addresses to show when reverse geocoding (default 5 addresses)


Changelog
---------
See [here](http://wordpress.org/extend/plugins/backpacktrack-for-android/changelog/ "changelog")

Frequently Asked Questions Frequently Asked Questions
-------------------------- --------------------------


Expand All @@ -79,7 +83,7 @@ Read [here](http://blog.bokhorst.biz/5283/computers-en-internet/backpacktrack-fo


**Where can I download the Android application?** **Where can I download the Android application?**


This is the [direct download link](https://github.com/downloads/M66B/BackPackTrack/BackPackTrack.apk "BackPackTrack for Android") to the latest version This is the [direct download link](https://github.com/downloads/M66B/BackPackTrack/BackPackTrack.0.4.apk "BackPackTrack for Android") to the latest version
on the [github project page](https://github.com/M66B/BackPackTrack "Android application"). on the [github project page](https://github.com/M66B/BackPackTrack "Android application").


**Why does the time of the locations differ from the clock time?** **Why does the time of the locations differ from the clock time?**
Expand Down
36 changes: 0 additions & 36 deletions proguard.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion default.properties → project.properties
Expand Up @@ -4,7 +4,7 @@
# This file must be checked in Version Control Systems. # This file must be checked in Version Control Systems.
# #
# To customize properties used by the Ant build system use, # To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your # "ant.properties", and override values to adapt the script to your
# project structure. # project structure.


# Project target. # Project target.
Expand Down
68 changes: 41 additions & 27 deletions src/biz/bokhorst/BPTMap.java
@@ -1,22 +1,23 @@
package biz.bokhorst; package biz.bokhorst;


/* /*
Copyright 2011 Marcel Bokhorst Copyright 2011, 2012 Marcel Bokhorst
All Rights Reserved
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or the Free Software Foundation; either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */


import java.util.List; import java.util.List;


Expand Down Expand Up @@ -72,17 +73,21 @@ public void onCreate(Bundle savedInstanceState) {
debug = isDebugBuild(); debug = isDebugBuild();
} catch (Exception e) { } catch (Exception e) {
} }
String apikey = debug ? getString(R.string.mvApikeyDebug) : getString(R.string.mvApikeyRelease); String apikey = debug ? getString(R.string.mvApikeyDebug)
: getString(R.string.mvApikeyRelease);


// Create map view // Create map view
mapView = new MapView(this, apikey); mapView = new MapView(this, apikey);
mapView.setClickable(true); mapView.setClickable(true);
MapView.LayoutParams mvlp = new MapView.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, MapView.LayoutParams mvlp = new MapView.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT, 0, 0, MapView.LayoutParams.CENTER); ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.FILL_PARENT, 0, 0,
MapView.LayoutParams.CENTER);
mapView.setLayoutParams(mvlp); mapView.setLayoutParams(mvlp);


// Create layout // Create layout
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.FILL_PARENT,
RelativeLayout.LayoutParams.FILL_PARENT); RelativeLayout.LayoutParams.FILL_PARENT);
RelativeLayout rl = new RelativeLayout(this); RelativeLayout rl = new RelativeLayout(this);
rl.setLayoutParams(lp); rl.setLayoutParams(lp);
Expand All @@ -103,7 +108,8 @@ public void onCreate(Bundle savedInstanceState) {
// Get map bounds // Get map bounds
double minLat = Double.MAX_VALUE, maxLat = Double.MIN_VALUE; double minLat = Double.MAX_VALUE, maxLat = Double.MIN_VALUE;
double minLon = Double.MAX_VALUE, maxLon = Double.MIN_VALUE; double minLon = Double.MAX_VALUE, maxLon = Double.MIN_VALUE;
String trackName = preferences.getString(Preferences.PREF_TRACKNAME, Preferences.PREF_TRACKNAME_DEFAULT); String trackName = preferences.getString(Preferences.PREF_TRACKNAME,
Preferences.PREF_TRACKNAME_DEFAULT);
Cursor c = databaseHelper.getPointList(trackName, true); Cursor c = databaseHelper.getPointList(trackName, true);
c.moveToNext(); c.moveToNext();
while (!c.isAfterLast()) { while (!c.isAfterLast()) {
Expand All @@ -128,7 +134,8 @@ public void onCreate(Bundle savedInstanceState) {
GeoPoint p = new GeoPoint((int) (lat * 1E6), (int) (lon * 1E6)); GeoPoint p = new GeoPoint((int) (lat * 1E6), (int) (lon * 1E6));
MapController mc = mapView.getController(); MapController mc = mapView.getController();
mc.setCenter(p); mc.setCenter(p);
mc.zoomToSpan((int) ((maxLat - minLat) * 1E6), (int) ((maxLon - minLon) * 1E6)); mc.zoomToSpan((int) ((maxLat - minLat) * 1E6),
(int) ((maxLon - minLon) * 1E6));
} }


// Apply overlay // Apply overlay
Expand Down Expand Up @@ -188,24 +195,30 @@ public boolean onOptionsItemSelected(MenuItem item) {
class MapOverlay extends com.google.android.maps.Overlay { class MapOverlay extends com.google.android.maps.Overlay {


@Override @Override
public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) { public boolean draw(Canvas canvas, MapView mapView, boolean shadow,
long when) {
super.draw(canvas, mapView, shadow); super.draw(canvas, mapView, shadow);


// Get current tags // Get current tags
String trackName = preferences.getString(Preferences.PREF_TRACKNAME, Preferences.PREF_TRACKNAME_DEFAULT); String trackName = preferences.getString(
Preferences.PREF_TRACKNAME,
Preferences.PREF_TRACKNAME_DEFAULT);


// Draw waypoints // Draw waypoints
Cursor cTP = databaseHelper.getPointList(trackName, true); Cursor cTP = databaseHelper.getPointList(trackName, true);
cTP.moveToNext(); cTP.moveToNext();
while (!cTP.isAfterLast()) { while (!cTP.isAfterLast()) {
GeoPoint p = new GeoPoint((int) (cTP.getDouble(cTP.getColumnIndex("LATITUDE")) * 1E6), (int) (cTP GeoPoint p = new GeoPoint(
.getDouble(cTP.getColumnIndex("LONGITUDE")) * 1E6)); (int) (cTP.getDouble(cTP.getColumnIndex("LATITUDE")) * 1E6),
(int) (cTP.getDouble(cTP.getColumnIndex("LONGITUDE")) * 1E6));


Point screenPts = new Point(); Point screenPts = new Point();
mapView.getProjection().toPixels(p, screenPts); mapView.getProjection().toPixels(p, screenPts);


Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.marker); Bitmap bmp = BitmapFactory.decodeResource(getResources(),
canvas.drawBitmap(bmp, screenPts.x, screenPts.y - bmp.getHeight(), null); R.drawable.marker);
canvas.drawBitmap(bmp, screenPts.x,
screenPts.y - bmp.getHeight(), null);
cTP.moveToNext(); cTP.moveToNext();
} }
cTP.close(); cTP.close();
Expand All @@ -223,8 +236,9 @@ public boolean draw(Canvas canvas, MapView mapView, boolean shadow, long when) {
Cursor cWpt = databaseHelper.getPointList(trackName, false); Cursor cWpt = databaseHelper.getPointList(trackName, false);
cWpt.moveToNext(); cWpt.moveToNext();
while (!cWpt.isAfterLast()) { while (!cWpt.isAfterLast()) {
GeoPoint p = new GeoPoint((int) (cWpt.getDouble(cWpt.getColumnIndex("LATITUDE")) * 1E6), (int) (cWpt GeoPoint p = new GeoPoint(
.getDouble(cWpt.getColumnIndex("LONGITUDE")) * 1E6)); (int) (cWpt.getDouble(cWpt.getColumnIndex("LATITUDE")) * 1E6),
(int) (cWpt.getDouble(cWpt.getColumnIndex("LONGITUDE")) * 1E6));
if (prev != null) { if (prev != null) {
Point p1 = new Point(); Point p1 = new Point();
Point p2 = new Point(); Point p2 = new Point();
Expand Down

0 comments on commit 2b07ac3

Please sign in to comment.