1
0
Fork 0

- Updated AdMob SDK

- Fix use of GPS from AdMob that was draining the battery
- Added Froyo app2sd support
- Some minor cleanups
This commit is contained in:
Carlos Mogas da Silva 2010-06-27 15:27:47 +01:00
parent fbbd2673ff
commit cef1b4d481
9 changed files with 21 additions and 24 deletions

View file

@ -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>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -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

Binary file not shown.

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<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>
<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>
<string name="app_name">Farmácias</string>
<string name="pref_gen_cat">General</string>
<string name="pref_gen_onservice">Only display on Service</string>
@ -27,7 +27,7 @@
<string name="menu_settings">Settings</string>
<string name="menu_list">List</string>
<string name="menu_about">About</string>
<string name="no_localization_active">You don't have any localization system active. Want to activate now?</string>
<string name="no_localization_active">You don\'t have any localization system active. Want to activate now?</string>
<string name="menu_get_gps_pos">Get GPS position</string>
<string name="menu_set_my_location">Set my location</string>
<string name="tap_on_screen">Tap on the screen to select your location</string>

View file

@ -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();
}

View file

@ -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);
}