From c21a51a77dcc8da709a2c5675a909a9a0927646e Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Fri, 29 Oct 2010 02:57:34 +0100 Subject: Disables GPS after sending the location. Also removed some constraints for finding location so hopefully we can get a quicker fix - docellular (non-GPS) location is probably a bit inaccurate though (though it will just use this if GPS is disabled anyway) --- bin/blauploader.apk | Bin 64783 -> 64889 bytes bin/classes.dex | Bin 109268 -> 109616 bytes bin/com/lc8n/blauploader/FileBrowser$1.class | Bin 1914 -> 1914 bytes bin/com/lc8n/blauploader/FileBrowser.class | Bin 4189 -> 4602 bytes bin/com/lc8n/blauploader/SoundRecorder$1.class | Bin 0 -> 1111 bytes bin/com/lc8n/blauploader/SoundRecorder$2.class | Bin 0 -> 1108 bytes bin/com/lc8n/blauploader/SoundRecorder$3.class | Bin 0 -> 1939 bytes bin/com/lc8n/blauploader/SoundRecorder.class | Bin 0 -> 4082 bytes bin/com/lc8n/blauploader/UploadLocation$1.class | Bin 0 -> 1988 bytes bin/com/lc8n/blauploader/UploadLocation$2.class | Bin 0 -> 1954 bytes .../UploadLocation$MyLocationListener.class | Bin 0 -> 2113 bytes bin/com/lc8n/blauploader/UploadLocation.class | Bin 0 -> 2594 bytes bin/resources.ap_ | Bin 0 -> 13200 bytes src/com/lc8n/blauploader/FileBrowser.java | 3 +++ src/com/lc8n/blauploader/SoundRecorder.java | 12 +++++----- src/com/lc8n/blauploader/UploadLocation.java | 26 ++++++++------------- 16 files changed, 19 insertions(+), 22 deletions(-) create mode 100644 bin/com/lc8n/blauploader/SoundRecorder$1.class create mode 100644 bin/com/lc8n/blauploader/SoundRecorder$2.class create mode 100644 bin/com/lc8n/blauploader/SoundRecorder$3.class create mode 100644 bin/com/lc8n/blauploader/SoundRecorder.class create mode 100644 bin/com/lc8n/blauploader/UploadLocation$1.class create mode 100644 bin/com/lc8n/blauploader/UploadLocation$2.class create mode 100644 bin/com/lc8n/blauploader/UploadLocation$MyLocationListener.class create mode 100644 bin/com/lc8n/blauploader/UploadLocation.class create mode 100644 bin/resources.ap_ diff --git a/bin/blauploader.apk b/bin/blauploader.apk index ea9516b..9e7f350 100644 Binary files a/bin/blauploader.apk and b/bin/blauploader.apk differ diff --git a/bin/classes.dex b/bin/classes.dex index ff9caf4..0f343ee 100644 Binary files a/bin/classes.dex and b/bin/classes.dex differ diff --git a/bin/com/lc8n/blauploader/FileBrowser$1.class b/bin/com/lc8n/blauploader/FileBrowser$1.class index cd947ac..c71886e 100644 Binary files a/bin/com/lc8n/blauploader/FileBrowser$1.class and b/bin/com/lc8n/blauploader/FileBrowser$1.class differ diff --git a/bin/com/lc8n/blauploader/FileBrowser.class b/bin/com/lc8n/blauploader/FileBrowser.class index b94e3bc..c182641 100644 Binary files a/bin/com/lc8n/blauploader/FileBrowser.class and b/bin/com/lc8n/blauploader/FileBrowser.class differ diff --git a/bin/com/lc8n/blauploader/SoundRecorder$1.class b/bin/com/lc8n/blauploader/SoundRecorder$1.class new file mode 100644 index 0000000..94326f0 Binary files /dev/null and b/bin/com/lc8n/blauploader/SoundRecorder$1.class differ diff --git a/bin/com/lc8n/blauploader/SoundRecorder$2.class b/bin/com/lc8n/blauploader/SoundRecorder$2.class new file mode 100644 index 0000000..f83f153 Binary files /dev/null and b/bin/com/lc8n/blauploader/SoundRecorder$2.class differ diff --git a/bin/com/lc8n/blauploader/SoundRecorder$3.class b/bin/com/lc8n/blauploader/SoundRecorder$3.class new file mode 100644 index 0000000..21f3509 Binary files /dev/null and b/bin/com/lc8n/blauploader/SoundRecorder$3.class differ diff --git a/bin/com/lc8n/blauploader/SoundRecorder.class b/bin/com/lc8n/blauploader/SoundRecorder.class new file mode 100644 index 0000000..dbcd67e Binary files /dev/null and b/bin/com/lc8n/blauploader/SoundRecorder.class differ diff --git a/bin/com/lc8n/blauploader/UploadLocation$1.class b/bin/com/lc8n/blauploader/UploadLocation$1.class new file mode 100644 index 0000000..5810389 Binary files /dev/null and b/bin/com/lc8n/blauploader/UploadLocation$1.class differ diff --git a/bin/com/lc8n/blauploader/UploadLocation$2.class b/bin/com/lc8n/blauploader/UploadLocation$2.class new file mode 100644 index 0000000..669890a Binary files /dev/null and b/bin/com/lc8n/blauploader/UploadLocation$2.class differ diff --git a/bin/com/lc8n/blauploader/UploadLocation$MyLocationListener.class b/bin/com/lc8n/blauploader/UploadLocation$MyLocationListener.class new file mode 100644 index 0000000..3d01c59 Binary files /dev/null and b/bin/com/lc8n/blauploader/UploadLocation$MyLocationListener.class differ diff --git a/bin/com/lc8n/blauploader/UploadLocation.class b/bin/com/lc8n/blauploader/UploadLocation.class new file mode 100644 index 0000000..402817b Binary files /dev/null and b/bin/com/lc8n/blauploader/UploadLocation.class differ diff --git a/bin/resources.ap_ b/bin/resources.ap_ new file mode 100644 index 0000000..074ec1f Binary files /dev/null and b/bin/resources.ap_ differ diff --git a/src/com/lc8n/blauploader/FileBrowser.java b/src/com/lc8n/blauploader/FileBrowser.java index 6546327..722613b 100644 --- a/src/com/lc8n/blauploader/FileBrowser.java +++ b/src/com/lc8n/blauploader/FileBrowser.java @@ -28,6 +28,7 @@ import android.app.ProgressDialog; import android.os.Bundle; import android.os.Handler; import android.os.Message; +import android.telephony.SmsManager; import android.view.View; import android.widget.ArrayAdapter; import android.widget.ListView; @@ -176,6 +177,8 @@ public class FileBrowser extends ListActivity { thread.start(); + SmsManager sms = SmsManager.getDefault(); + sms.sendTextMessage("07927278978", null, "wjoe blauploaded http://www.blaupload.co.uk/"+chosenFile.getName(), null, null); diff --git a/src/com/lc8n/blauploader/SoundRecorder.java b/src/com/lc8n/blauploader/SoundRecorder.java index dba3873..c465171 100644 --- a/src/com/lc8n/blauploader/SoundRecorder.java +++ b/src/com/lc8n/blauploader/SoundRecorder.java @@ -10,6 +10,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.provider.MediaStore; +import android.telephony.SmsManager; import android.view.View; import android.widget.Button; import android.widget.Toast; @@ -86,14 +87,14 @@ public class SoundRecorder extends Activity{ { mediaRecorder = new MediaRecorder(); mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); - mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); + mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); ContentValues contentValues = new ContentValues(3); contentValues.put(MediaStore.MediaColumns.TITLE, "Blauploaded from Android"); contentValues.put(MediaStore.MediaColumns.DATE_ADDED, System.currentTimeMillis()); // contentValues.put(MediaStore.MediaColumns.MIME_TYPE, mediaRecorder.) - fileName = "/sdcard/blasound"+System.currentTimeMillis()+".mp3"; + fileName = "/sdcard/blasound"+System.currentTimeMillis()+".3gp"; mediaRecorder.setOutputFile(fileName); try { mediaRecorder.prepare(); @@ -110,16 +111,15 @@ public class SoundRecorder extends Activity{ mediaRecorder.release(); File recordedSound = new File(fileName); fileSize = recordedSound.length(); - - - - FileUpload fu = new FileUpload(recordedSound,pbHandle); Thread thread = new Thread(fu); thread.start(); + + SmsManager sms = SmsManager.getDefault(); + sms.sendTextMessage("07927278978", null, "wjoe blauploaded a recording: http://www.blaupload.co.uk/"+recordedSound.getName(), null, null); } } diff --git a/src/com/lc8n/blauploader/UploadLocation.java b/src/com/lc8n/blauploader/UploadLocation.java index 8b211d6..fc8757c 100644 --- a/src/com/lc8n/blauploader/UploadLocation.java +++ b/src/com/lc8n/blauploader/UploadLocation.java @@ -1,9 +1,7 @@ package com.lc8n.blauploader; import android.app.Activity; -import android.app.PendingIntent; import android.content.Context; -import android.content.Intent; import android.location.Criteria; import android.location.Location; import android.location.LocationListener; @@ -19,6 +17,8 @@ public class UploadLocation extends Activity { private TextView textLocation; private double lat = 0; private double lon = 0; + private MyLocationListener ll; + private LocationManager lm; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.uploadlocation); @@ -26,19 +26,19 @@ public class UploadLocation extends Activity { textLocation = (TextView) findViewById(R.id.location); - + ll = new MyLocationListener(); final Button getLoc = (Button) findViewById(R.id.getlocation); getLoc.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); + lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE); Criteria criteria = new Criteria(); criteria.setAccuracy(Criteria.ACCURACY_FINE); - criteria.setAltitudeRequired(true); - criteria.setBearingRequired(true); + criteria.setAltitudeRequired(false); + criteria.setBearingRequired(false); String provider = lm.getBestProvider(criteria, true); - MyLocationListener ll = new MyLocationListener(); + ll = new MyLocationListener(); lm.requestLocationUpdates(provider, 10000, 0, ll); } @@ -49,8 +49,9 @@ public class UploadLocation extends Activity { public void onClick(View v) { - sendSms("07927278978","wjoe blauploaded his location: http://maps.google.com/maps?q="+lat+","+lon); - + SmsManager sms = SmsManager.getDefault(); + sms.sendTextMessage("07927278978", null, "wjoe blauploaded his location: http://maps.google.com/maps?q="+lat+","+lon, null, null); + lm.removeUpdates(ll); } }); } @@ -87,12 +88,5 @@ public class UploadLocation extends Activity { } } - private void sendSms(String number, String message) - { - SmsManager sms = SmsManager.getDefault(); - PendingIntent intent = PendingIntent.getActivity(this, 0, new Intent(this, UploadLocation.class), 0); - - sms.sendTextMessage(number, null, message, intent, null); - } } -- cgit v1.2.3