Browse Source

- Updated AdMob SDK

- Fix use of GPS from AdMob that was draining the battery
- Added Froyo app2sd support
- Some minor cleanups
Carlos Mogas da Silva 9 years ago
parent
commit
cef1b4d481

+ 11
- 9
AndroidManifest.xml View File

@@ -1,10 +1,10 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
-      package="org.r3pek.pharmacies" android:versionCode="9" android:versionName="2.0">
3
+      package="org.r3pek.pharmacies" android:versionCode="10" android:versionName="2.0.1" android:installLocation="auto">
4 4
     <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="false">
5
-    <activity android:name="MyPreferences"></activity>
6
-    <activity android:name="PharmacyList"></activity>
7
-	<activity android:name="PharmacyInfo"></activity>
5
+    <activity android:name="MyPreferences"/>
6
+    <activity android:name="PharmacyList"/>
7
+	<activity android:name="PharmacyInfo"/>
8 8
 	<activity android:label="@string/app_name" android:name="ViewOnMap">
9 9
             <intent-filter>
10 10
                 <action android:name="android.intent.action.MAIN" />
@@ -13,10 +13,12 @@
13 13
 	</activity>
14 14
 	<uses-library android:name="com.google.android.maps" />
15 15
 	<meta-data android:value="a14be6d1c69912b" android:name="ADMOB_PUBLISHER_ID"/>
16
+	<meta-data android:value="false" android:name="ADMOB_ALLOW_LOCATION_FOR_ADS" />
16 17
 </application>
17
-<uses-sdk android:minSdkVersion="3"/>
18
-<uses-permission android:name="android.permission.INTERNET"></uses-permission>
19
-<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
20
-<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"></uses-permission>
21
-<supports-screens android:smallScreens="true" android:normalScreens="true" android:resizeable="true" android:largeScreens="true" android:anyDensity="false"></supports-screens>
18
+<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="8"/>
19
+<uses-permission android:name="android.permission.INTERNET"/>
20
+<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
21
+<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/>
22
+<supports-screens android:smallScreens="true" android:normalScreens="true" android:resizeable="true" android:largeScreens="true" android:anyDensity="false"/>
23
+<uses-feature android:name="android.hardware.location" android:required="false"/>
22 24
 </manifest> 

BIN
bin/Farmacias.apk View File


BIN
bin/classes.dex View File


BIN
bin/resources.ap_ View File


+ 2
- 2
default.properties View File

@@ -7,7 +7,7 @@
7 7
 # "build.properties", and override values to adapt the script to your
8 8
 # project structure.
9 9
 
10
+# Project target.
11
+target=Google Inc.:Google APIs:8
10 12
 # Indicates whether an apk should be generated for each density.
11 13
 split.density=false
12
-# Project target.
13
-target=Google Inc.:Google APIs:4

BIN
libs/admob-sdk-android.jar View File


res/values-en/strings.xml → res/values/strings.xml View File

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="utf-8"?>
2 2
 <resources>
3
-	<string name="about">Fármacias was developed by Carlos Silva and uses Sapo's services to fetch the information about the pharmacies. If the application was usefull, and if you want to, make a donation at www.r3pek.org. It also uses some icons from Yusuke Kamiyamane (p.yusukekamiyamane.com). Thanks.</string>
3
+	<string name="about">Fármacias was developed by Carlos Silva and uses Sapo\'s services to fetch the information about the pharmacies. If the application was usefull, and if you want to, make a donation at www.r3pek.org. It also uses some icons from Yusuke Kamiyamane (p.yusukekamiyamane.com). Thanks.</string>
4 4
 	<string name="app_name">Farmácias</string>
5 5
 	<string name="pref_gen_cat">General</string>
6 6
 	<string name="pref_gen_onservice">Only display on Service</string>
@@ -27,7 +27,7 @@
27 27
 	<string name="menu_settings">Settings</string>
28 28
 	<string name="menu_list">List</string>
29 29
 	<string name="menu_about">About</string>
30
-	<string name="no_localization_active">You don't have any localization system active. Want to activate now?</string>
30
+	<string name="no_localization_active">You don\'t have any localization system active. Want to activate now?</string>
31 31
 	<string name="menu_get_gps_pos">Get GPS position</string>
32 32
 	<string name="menu_set_my_location">Set my location</string>
33 33
 	<string name="tap_on_screen">Tap on the screen to select your location</string>

+ 4
- 0
src/org/r3pek/pharmacies/PharmacyInfo.java View File

@@ -1,5 +1,7 @@
1 1
 package org.r3pek.pharmacies;
2 2
 
3
+import com.admob.android.ads.AdView;
4
+
3 5
 import org.r3pek.pharmacies.utils.GeoUtils;
4 6
 import org.r3pek.pharmacies.utils.GlobalVars;
5 7
 import org.r3pek.pharmacies.widgets.Arrow;
@@ -73,6 +75,8 @@ public class PharmacyInfo extends Activity {
73 75
 	public void onPause() {
74 76
 		arrowChangerSensor.delImage((Arrow)findViewById(R.id.ivInfoDirection));
75 77
     	sm.unregisterListener(arrowChangerSensor);
78
+    	AdView ad = (AdView) findViewById(R.id.ad);
79
+    	ad.cleanup();
76 80
     	super.onPause();
77 81
 	}
78 82
 	

+ 2
- 11
src/org/r3pek/pharmacies/utils/Positioner.java View File

@@ -1,15 +1,14 @@
1 1
 package org.r3pek.pharmacies.utils;
2 2
 
3
-import java.util.LinkedList;
3
+import com.google.android.maps.GeoPoint;
4 4
 
5 5
 import android.content.Context;
6 6
 import android.location.Location;
7 7
 import android.location.LocationListener;
8 8
 import android.location.LocationManager;
9 9
 import android.os.Bundle;
10
-import android.util.Log;
11 10
 
12
-import com.google.android.maps.GeoPoint;
11
+import java.util.LinkedList;
13 12
 
14 13
 public class Positioner implements LocationListener {
15 14
 	private Location currentLocation;
@@ -57,7 +56,6 @@ public class Positioner implements LocationListener {
57 56
 	
58 57
 	public void requestUpdates() {
59 58
 		if (isUpdating) return;
60
-		Log.d("Positioner", "Enabling location Updates");
61 59
 
62 60
 		if (getBestLocationProvider().equals(LocationManager.GPS_PROVIDER) && !hadGPSFix)
63 61
 			locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this);
@@ -68,7 +66,6 @@ public class Positioner implements LocationListener {
68 66
 	
69 67
 	public void cancelUpdates() {
70 68
 		if (!isUpdating) return;
71
-		Log.d("Positioner", "Disabling location Updates");
72 69
 
73 70
 		locationManager.removeUpdates(this);
74 71
 		
@@ -81,12 +78,10 @@ public class Positioner implements LocationListener {
81 78
 	}
82 79
 	
83 80
 	public void registerNotification(OnPositionChangeListener object) {
84
-		Log.d("Positioner", "Adding notification " + object.getClass().getCanonicalName());
85 81
 		toNotify.add(object);
86 82
 	}
87 83
 	
88 84
 	public void unregisterNotification(OnPositionChangeListener object) {
89
-		Log.d("Positioner", "Removing notification " + object.getClass().getCanonicalName());
90 85
 		toNotify.remove(object);
91 86
 	}
92 87
 	
@@ -104,8 +99,6 @@ public class Positioner implements LocationListener {
104 99
 
105 100
 	@Override
106 101
 	public synchronized void onLocationChanged(Location location) {
107
-		Log.d("Positioner", "New location arrived");
108
-		
109 102
 		/* If we already have a GPS fix, discard Network locations */
110 103
 		if (hadGPSFix && location.getProvider().equals(LocationManager.NETWORK_PROVIDER)) 
111 104
 			return;
@@ -136,7 +129,6 @@ public class Positioner implements LocationListener {
136 129
 
137 130
 	@Override
138 131
 	public void onProviderEnabled(String provider) {
139
-		Log.d("Positioner", "Provider enabled: " + provider);
140 132
 		initLocation();
141 133
 	}
142 134
 
@@ -145,7 +137,6 @@ public class Positioner implements LocationListener {
145 137
 	}
146 138
 	
147 139
 	private synchronized void notifyAllClients() {
148
-		Log.d("Positioner", "Notifying clients");
149 140
 		for (OnPositionChangeListener l : toNotify)
150 141
 			l.onLocationChange(currentGeoPoint, currentAccuracy);
151 142
 	}

Loading…
Cancel
Save