Browse Source

- Updated AdMob SDK

- Fix use of GPS from AdMob that was draining the battery
- Added Froyo app2sd support
- Some minor cleanups
master
Carlos Mogas da Silva 11 years ago
parent
commit
cef1b4d481
  1. 20
      AndroidManifest.xml
  2. BIN
      bin/Farmacias.apk
  3. BIN
      bin/classes.dex
  4. BIN
      bin/resources.ap_
  5. 4
      default.properties
  6. BIN
      libs/admob-sdk-android.jar
  7. 4
      res/values/strings.xml
  8. 4
      src/org/r3pek/pharmacies/PharmacyInfo.java
  9. 13
      src/org/r3pek/pharmacies/utils/Positioner.java

20
AndroidManifest.xml

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

BIN
bin/Farmacias.apk

BIN
bin/classes.dex

BIN
bin/resources.ap_

4
default.properties

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

BIN
libs/admob-sdk-android.jar

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

4
src/org/r3pek/pharmacies/PharmacyInfo.java

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

13
src/org/r3pek/pharmacies/utils/Positioner.java

@ -1,15 +1,14 @@
package org.r3pek.pharmacies.utils;
import java.util.LinkedList;
import com.google.android.maps.GeoPoint;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
import com.google.android.maps.GeoPoint;
import java.util.LinkedList;
public class Positioner implements LocationListener {
private Location currentLocation;
@ -57,7 +56,6 @@ public class Positioner implements LocationListener {
public void requestUpdates() {
if (isUpdating) return;
Log.d("Positioner", "Enabling location Updates");
if (getBestLocationProvider().equals(LocationManager.GPS_PROVIDER) && !hadGPSFix)
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this);
@ -68,7 +66,6 @@ public class Positioner implements LocationListener {
public void cancelUpdates() {
if (!isUpdating) return;
Log.d("Positioner", "Disabling location Updates");
locationManager.removeUpdates(this);
@ -81,12 +78,10 @@ public class Positioner implements LocationListener {
}
public void registerNotification(OnPositionChangeListener object) {
Log.d("Positioner", "Adding notification " + object.getClass().getCanonicalName());
toNotify.add(object);
}
public void unregisterNotification(OnPositionChangeListener object) {
Log.d("Positioner", "Removing notification " + object.getClass().getCanonicalName());
toNotify.remove(object);
}
@ -104,8 +99,6 @@ public class Positioner implements LocationListener {
@Override
public synchronized void onLocationChanged(Location location) {
Log.d("Positioner", "New location arrived");
/* If we already have a GPS fix, discard Network locations */
if (hadGPSFix && location.getProvider().equals(LocationManager.NETWORK_PROVIDER))
return;
@ -136,7 +129,6 @@ public class Positioner implements LocationListener {
@Override
public void onProviderEnabled(String provider) {
Log.d("Positioner", "Provider enabled: " + provider);
initLocation();
}
@ -145,7 +137,6 @@ public class Positioner implements LocationListener {
}
private synchronized void notifyAllClients() {
Log.d("Positioner", "Notifying clients");
for (OnPositionChangeListener l : toNotify)
l.onLocationChange(currentGeoPoint, currentAccuracy);
}

Loading…
Cancel
Save