¡@

Home 

2014/10/16 ¤W¤È 08:21:39

android Programming Glossary: provider

Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4)

http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-and-mms-in-android-pre-kit-kat-android-4-4

private static final String ACTION_SMS_RECEIVED android.provider.Telephony.SMS_RECEIVED private Context mContext private Intent.. intent filter action android name android.provider.Telephony.SMS_RECEIVED intent filter receiver application manifest.. intent filter action android name android.provider.Telephony.WAP_PUSH_RECEIVED data android mimeType application..

J2ME/Android/BlackBerry - driving directions, route between two locations

http://stackoverflow.com/questions/2023669/j2me-android-blackberry-driving-directions-route-between-two-locations

authorization from Google or as applicable from the provider of particular Content Google's licenses above are subject to..

How to draw a path on a map using kml file?

http://stackoverflow.com/questions/3109158/how-to-draw-a-path-on-a-map-using-kml-file

@Override public void onProviderDisabled String provider TODO Auto generated method stub @Override public void onProviderEnabled.. method stub @Override public void onProviderEnabled String provider TODO Auto generated method stub @Override public void onStatusChanged.. method stub @Override public void onStatusChanged String provider int status Bundle extras TODO Auto generated method stub Please..

What is the simplest and most robust way to get the user's current location in Android?

http://stackoverflow.com/questions/3145089/what-is-the-simplest-and-most-robust-way-to-get-the-users-current-location-in-a

as long as it has either a GPS or a Network Location provider. It seems like it shouldn't be that hard but it appears to me.. to me that I have to spin up two different location providers GPS and NETWORK and manage each's lifecycle. Not only that.. past to cut the solution down to just using one location provider but that seems to only give you the best theoretical provider..

Enable GPS programatically like Tasker

http://stackoverflow.com/questions/4721449/enable-gps-programatically-like-tasker

some example code i use private void turnGPSOn String provider Settings.Secure.getString getContentResolver Settings.Secure.LOCATION_PROVIDERS_ALLOWED.. Settings.Secure.LOCATION_PROVIDERS_ALLOWED if provider.contains gps if gps is disabled final Intent poke new Intent.. 3 sendBroadcast poke private void turnGPSOff String provider Settings.Secure.getString getContentResolver Settings.Secure.LOCATION_PROVIDERS_ALLOWED..

Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4)

http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-and-mms-in-android-pre-kit-kat-android-4-4

this to work Also I am aware that the SMS MMS ContentProvider is not a part of the official Android SDK but I was thinking.. any changes to the content mms sms conversations Content Provider consequently allowing you to detect incoming MMS. Here is the.. The error gets thrown after querying the Carriers ContentProvider in the getMMSApns method of the APNHelper class. final Cursor..

LocationListener of NETWORK_PROVIDER is enabled but , onLocationChanged is never called

http://stackoverflow.com/questions/15747543/locationlistener-of-network-provider-is-enabled-but-onlocationchanged-is-never

know why. It for some reason stop being called but the Provider is enable and the Lister is working when I Enable or disable.. and the Lister is working when I Enable or disable the Provider manually onProviderEnabled and onProviderDisabled is called... working when I Enable or disable the Provider manually onProviderEnabled and onProviderDisabled is called. It just happens with..

Picasso loading of image spawned inside AsyncTask

http://stackoverflow.com/questions/18808114/picasso-loading-of-image-spawned-inside-asynctask

to Picasso I need to make a query to the Contacts Content Provider . Since I don't want to block the main UI thread to get the..

Sending Email in Android using JavaMail API without using the default/built-in app

http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-built-in-a

String password private Session session static Security.addProvider new com.provider.JSSEProvider public GMailSender String user.. session static Security.addProvider new com.provider.JSSEProvider public GMailSender String user String password this.user user.. IOException throw new IOException Not Supported JSSE Provider Licensed to the Apache Software Foundation ASF under one or..

J2ME/Android/BlackBerry - driving directions, route between two locations

http://stackoverflow.com/questions/2023669/j2me-android-blackberry-driving-directions-route-between-two-locations

directions share improve this question J2ME Map Route Provider maps.google.com has a navigation service which can provide you.. static Road getRoute InputStream is Full source code RoadProvider.java BlackBerry class MapPathScreen extends MainScreen MapControl.. double toLat 50.45 toLon 30.523333 String url RoadProvider.getUrl fromLat fromLon toLat toLon InputStream is getConnection..

How to create a BKS (BouncyCastle) format Java Keystore that contains a client certificate chain

http://stackoverflow.com/questions/4065379/how-to-create-a-bks-bouncycastle-format-java-keystore-that-contains-a-client-c

provider org.bouncycastle.jce.provider.BouncyCastleProvider providerpath bcprov jdk16 145.jar storetype BKS storepass testtest.. provider org.bouncycastle.jce.provider.BouncyCastleProvider providerpath bcprov jdk16 145.jar storetype BKS storepass testtest.. for PC using one of the below methods. Adding the BC Provider Statically Recommended Copy the bcprov ext jdk15on 1.46.jar..

sqlite example program in android [closed]

http://stackoverflow.com/questions/4721732/sqlite-example-program-in-android

db.execSQL DROP TABLE IF EXISTS TABLE_NAME onCreate db 3.Provider class package com.mypackage.quaddeals import static android.provider.BaseColumns._ID.. android.app.SearchManager import android.content.ContentProvider import android.content.ContentUris import android.content.ContentValues.. import android.util.Log public class Bru_Press_Provider extends ContentProvider private static final int QUADUSER 1..

Android Java - Joda Date is slow

http://stackoverflow.com/questions/5059663/android-java-joda-date-is-slow

this information. However simply calling DateTimeZone.setProvider custom provider instance ... is not sufficient because for reasons.. has a static initializer where it calls getDefaultProvider . To be completely safe you can override this default by setting.. System.setProperty org.joda.time.DateTimeZone.Provider com.your.package.FastDateTimeZoneProvider Then all you have..

Why does ContentResolver.requestSync not trigger a sync?

http://stackoverflow.com/questions/5253858/why-does-contentresolver-requestsync-not-trigger-a-sync

not trigger a sync I am trying to implement the Content Provider Sync Adapter pattern as discussed at Google IO slide 26. My.. account authority bundle from my ContentProvider my sync is never triggered. ContentResolver.requestSync account.. ContentResolver.notifyChange is a function used by ContentProviders to notify Android that the local database has been changed...

Good way of getting the user's location in Android

http://stackoverflow.com/questions/6181704/good-way-of-getting-the-users-location-in-android

done Looper l getLooper if l null l.quit public void onProviderEnabled String provider public void onProviderDisabled String.. void onProviderEnabled String provider public void onProviderDisabled String provider public void onStatusChanged String.. new location are from the same provider boolean isFromSameProvider isSameProvider location.getProvider currentBestLocation.getProvider..

Android Process Scheduling

http://stackoverflow.com/questions/7931032/android-process-scheduling

if an application has a dependency on a Service or Content Provider supplied by a second application the secondary application will..

Images taken with ACTION_IMAGE_CAPTURE always returns 1 for ExifInterface.TAG_ORIENTATION on some newer devices

http://stackoverflow.com/questions/8450539/images-taken-with-action-image-capture-always-returns-1-for-exifinterface-tag-or

app from my app. THen on activity result I query the Media Provider to see if any pictures were saved after this timestamp I saved...

Background service need to send GPS location on server

http://stackoverflow.com/questions/8095030/background-service-need-to-send-gps-location-on-server

c.setAccuracy Criteria.ACCURACY_COARSE final String PROVIDER lm.getBestProvider c true MyLocationListener new MyLocationListener.. new MyLocationListener lm.requestLocationUpdates PROVIDER 600000 0 MyLocationListener Log.d LOC_SERVICE Service RUNNING..

What are best practices for using AES encryption in Android?

http://stackoverflow.com/questions/8622367/what-are-best-practices-for-using-aes-encryption-in-android

implements ICrypto public static final String PROVIDER BC public static final int SALT_LENGTH 20 public static final.. encryptionCipher Cipher.getInstance CIPHER_ALGORITHM PROVIDER encryptionCipher.init Cipher.ENCRYPT_MODE secret ivspec byte.. decryptionCipher Cipher.getInstance CIPHER_ALGORITHM PROVIDER String ivHex encrypted.substring 0 IV_LENGTH 2 String encryptedHex..

OnLocationChanged callback is never called

http://stackoverflow.com/questions/9007600/onlocationchanged-callback-is-never-called

changed s public void onProviderEnabled String s Log.e TAG PROVIDER DISABLED s public void onProviderDisabled String s Log.e TAG.. s public void onProviderDisabled String s Log.e TAG PROVIDER DISABLED s My permissions in the AndroidManifest uses permission.. look like requestLocationUpdates LocationManager.GPS_PROVIDER 0 0 locationListener requestLocationUpdates LocationManager.NETWORK_PROVIDER..

Android Periodic GPS location updates with AlarmManager inside a Service

http://stackoverflow.com/questions/9869153/android-periodic-gps-location-updates-with-alarmmanager-inside-a-service

mLocationManager.getBestProvider mCriteria true Log.i BEST PROVIDER IS mLocationProvider It says BEST PROVIDER IS gps. But this.. true Log.i BEST PROVIDER IS mLocationProvider It says BEST PROVIDER IS gps. But this log inside onProviderEnabled is never shown.. LocationManager.GPS_PROVIDER 0 0 mLocationListener it doesn't work either. This however..

Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4)

http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-and-mms-in-android-pre-kit-kat-android-4-4

final String DEBUG_TAG getClass .getSimpleName .toString private static final String ACTION_SMS_RECEIVED android.provider.Telephony.SMS_RECEIVED private Context mContext private Intent mIntent Retrieve SMS public void onReceive Context context.. ... SMS Receiver receiver android name com.myexample.receivers.SMSReceiver intent filter action android name android.provider.Telephony.SMS_RECEIVED intent filter receiver application manifest However I was wondering if you could send and receive.. receive MMS messages receiver android name com.sendit.receivers.MMSReceiver intent filter action android name android.provider.Telephony.WAP_PUSH_RECEIVED data android mimeType application vnd.wap.mms message intent filter receiver In the MMSReceiver..

J2ME/Android/BlackBerry - driving directions, route between two locations

http://stackoverflow.com/questions/2023669/j2me-android-blackberry-driving-directions-route-between-two-locations

under the Terms or unless you have received prior written authorization from Google or as applicable from the provider of particular Content Google's licenses above are subject to your adherence to all of the restrictions below. Except as..

How to draw a path on a map using kml file?

http://stackoverflow.com/questions/3109158/how-to-draw-a-path-on-a-map-using-kml-file

int loc.getLongitude 1E6 mc.animateTo p mapView.invalidate @Override public void onProviderDisabled String provider TODO Auto generated method stub @Override public void onProviderEnabled String provider TODO Auto generated method stub.. void onProviderDisabled String provider TODO Auto generated method stub @Override public void onProviderEnabled String provider TODO Auto generated method stub @Override public void onStatusChanged String provider int status Bundle extras TODO Auto.. void onProviderEnabled String provider TODO Auto generated method stub @Override public void onStatusChanged String provider int status Bundle extras TODO Auto generated method stub Please can someone tell me what's I'm doing wrong here android..

What is the simplest and most robust way to get the user's current location in Android?

http://stackoverflow.com/questions/3145089/what-is-the-simplest-and-most-robust-way-to-get-the-users-current-location-in-a

few mins or so but it's not a huge priority. Work for any device as long as it has either a GPS or a Network Location provider. It seems like it shouldn't be that hard but it appears to me that I have to spin up two different location providers GPS.. provider. It seems like it shouldn't be that hard but it appears to me that I have to spin up two different location providers GPS and NETWORK and manage each's lifecycle. Not only that but I have to duplicate the same code in multiple activities.. to satisfy #2. I've tried using getBestProvider in the past to cut the solution down to just using one location provider but that seems to only give you the best theoretical provider rather than the provider that's actually going to give you..

Enable GPS programatically like Tasker

http://stackoverflow.com/questions/4721449/enable-gps-programatically-like-tasker

power manager widget. see this xda thread for discussion. here's some example code i use private void turnGPSOn String provider Settings.Secure.getString getContentResolver Settings.Secure.LOCATION_PROVIDERS_ALLOWED if provider.contains gps if gps.. turnGPSOn String provider Settings.Secure.getString getContentResolver Settings.Secure.LOCATION_PROVIDERS_ALLOWED if provider.contains gps if gps is disabled final Intent poke new Intent poke.setClassName com.android.settings com.android.settings.widget.SettingsAppWidgetProvider.. Intent.CATEGORY_ALTERNATIVE poke.setData Uri.parse 3 sendBroadcast poke private void turnGPSOff String provider Settings.Secure.getString getContentResolver Settings.Secure.LOCATION_PROVIDERS_ALLOWED if provider.contains gps if gps..

Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4)

http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-and-mms-in-android-pre-kit-kat-android-4-4

a standard way of sending and receiving MMS . Has anyone gotten this to work Also I am aware that the SMS MMS ContentProvider is not a part of the official Android SDK but I was thinking someone may have been able to implement this. Any help is greatly.. a ContentObserver . That way you can detect when there are any changes to the content mms sms conversations Content Provider consequently allowing you to detect incoming MMS. Here is the closest example to get this to work that I have found Receiving.. current process has android.permission.WRITE_APN_SETTINGS. The error gets thrown after querying the Carriers ContentProvider in the getMMSApns method of the APNHelper class. final Cursor apnCursor this.context.getContentResolver .query Uri.withAppendedPath..

LocationListener of NETWORK_PROVIDER is enabled but , onLocationChanged is never called

http://stackoverflow.com/questions/15747543/locationlistener-of-network-provider-is-enabled-but-onlocationchanged-is-never

the Network provider listener stop to being called and I don't know why. It for some reason stop being called but the Provider is enable and the Lister is working when I Enable or disable the Provider manually onProviderEnabled and onProviderDisabled.. It for some reason stop being called but the Provider is enable and the Lister is working when I Enable or disable the Provider manually onProviderEnabled and onProviderDisabled is called. It just happens with NETWORK_PROVIDER the GPS_PROVIDER works.. being called but the Provider is enable and the Lister is working when I Enable or disable the Provider manually onProviderEnabled and onProviderDisabled is called. It just happens with NETWORK_PROVIDER the GPS_PROVIDER works well. Listener LocationListener..

Picasso loading of image spawned inside AsyncTask

http://stackoverflow.com/questions/18808114/picasso-loading-of-image-spawned-inside-asynctask

and caching. In order to get the contactUri to pass to Picasso I need to make a query to the Contacts Content Provider . Since I don't want to block the main UI thread to get the contactId I have put this in an AsyncTask . And once I get that..

Sending Email in Android using JavaMail API without using the default/built-in app

http://stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-built-in-a

String mailhost smtp.gmail.com private String user private String password private Session session static Security.addProvider new com.provider.JSSEProvider public GMailSender String user String password this.user user this.password password Properties.. private String user private String password private Session session static Security.addProvider new com.provider.JSSEProvider public GMailSender String user String password this.user user this.password password Properties props new Properties props.setProperty.. public OutputStream getOutputStream throws IOException throw new IOException Not Supported JSSE Provider Licensed to the Apache Software Foundation ASF under one or more contributor license agreements. See the NOTICE file distributed..

J2ME/Android/BlackBerry - driving directions, route between two locations

http://stackoverflow.com/questions/2023669/j2me-android-blackberry-driving-directions-route-between-two-locations

Thanks android blackberry java me geolocation driving directions share improve this question J2ME Map Route Provider maps.google.com has a navigation service which can provide you route information in KML format. To get kml file we need.. pass this InputStream and get parsed data structure public static Road getRoute InputStream is Full source code RoadProvider.java BlackBerry class MapPathScreen extends MainScreen MapControl map Road mRoad new Road public MapPathScreen double fromLat.. new Road public MapPathScreen double fromLat 49.85 fromLon 24.016667 double toLat 50.45 toLon 30.523333 String url RoadProvider.getUrl fromLat fromLon toLat toLon InputStream is getConnection url mRoad RoadProvider.getRoute is map new MapControl add..

How to create a BKS (BouncyCastle) format Java Keystore that contains a client certificate chain

http://stackoverflow.com/questions/4065379/how-to-create-a-bks-bouncycastle-format-java-keystore-that-contains-a-client-c

trustcacerts file cacert.pem alias ca keystore mySrvTruststore.bks provider org.bouncycastle.jce.provider.BouncyCastleProvider providerpath bcprov jdk16 145.jar storetype BKS storepass testtest Here is the command I've tried that is NOT working to.. openssl x509 in client.pem alias client keystore clientkeystore provider org.bouncycastle.jce.provider.BouncyCastleProvider providerpath bcprov jdk16 145.jar storetype BKS storepass testtest java android ssl share improve this question Detailed.. 1.46.jar or take it from the doc folder. Configure BouncyCastle for PC using one of the below methods. Adding the BC Provider Statically Recommended Copy the bcprov ext jdk15on 1.46.jar to each D tools jdk1.5.0_09 jre lib ext JDK bundled JRE D tools..

sqlite example program in android [closed]

http://stackoverflow.com/questions/4721732/sqlite-example-program-in-android

onUpgrade SQLiteDatabase db int oldVersion int newVersion db.execSQL DROP TABLE IF EXISTS TABLE_NAME onCreate db 3.Provider class package com.mypackage.quaddeals import static android.provider.BaseColumns._ID import static com.mypackage.quaddeals.Constants.CONTENT_URI.. static com.mypackage.quaddeals.Constants.TABLE_NAME import android.app.SearchManager import android.content.ContentProvider import android.content.ContentUris import android.content.ContentValues import android.content.UriMatcher import android.database.Cursor.. import android.net.Uri import android.text.TextUtils import android.util.Log public class Bru_Press_Provider extends ContentProvider private static final int QUADUSER 1 private static final int QUADUSER_ID 2 The MIME type of a directory..

Android Java - Joda Date is slow

http://stackoverflow.com/questions/5059663/android-java-joda-date-is-slow

a jar file and then reading the manifest to try to get this information. However simply calling DateTimeZone.setProvider custom provider instance ... is not sufficient because for reasons that don't make sense to me DateTimeZone has a static.. because for reasons that don't make sense to me DateTimeZone has a static initializer where it calls getDefaultProvider . To be completely safe you can override this default by setting this system property before you ever call anything in the.. add this @Override public void onCreate Bundle savedInstanceState System.setProperty org.joda.time.DateTimeZone.Provider com.your.package.FastDateTimeZoneProvider Then all you have to do is define FastDateTimeZoneProvider . I wrote the following..

Why does ContentResolver.requestSync not trigger a sync?

http://stackoverflow.com/questions/5253858/why-does-contentresolver-requestsync-not-trigger-a-sync

does ContentResolver.requestSync not trigger a sync I am trying to implement the Content Provider Sync Adapter pattern as discussed at Google IO slide 26. My content provider is working and my sync works when I trigger.. Tools Sync Tester application however when I call ContentResolver.requestSync account authority bundle from my ContentProvider my sync is never triggered. ContentResolver.requestSync account AUTHORITY new Bundle Edit added manifest snippet My manifest.. Be aware of ContentResolver.notifyChange One tricky thing. ContentResolver.notifyChange is a function used by ContentProviders to notify Android that the local database has been changed. This serves two functions first it will cause cursors following..

Good way of getting the user's location in Android

http://stackoverflow.com/questions/6181704/good-way-of-getting-the-users-location-in-android

bestLocation LocationQuality.GOOD return We're done Looper l getLooper if l null l.quit public void onProviderEnabled String provider public void onProviderDisabled String provider public void onStatusChanged String provider int.. return We're done Looper l getLooper if l null l.quit public void onProviderEnabled String provider public void onProviderDisabled String provider public void onStatusChanged String provider int status Bundle extras TODO Auto generated method.. accuracyDelta 200 Check if the old and new location are from the same provider boolean isFromSameProvider isSameProvider location.getProvider currentBestLocation.getProvider Determine location quality using a combination of timeliness..

Android Process Scheduling

http://stackoverflow.com/questions/7931032/android-process-scheduling

priority is also affected by interprocess dependencies if an application has a dependency on a Service or Content Provider supplied by a second application the secondary application will have at least as high a priority as the application it supports...

Images taken with ACTION_IMAGE_CAPTURE always returns 1 for ExifInterface.TAG_ORIENTATION on some newer devices

http://stackoverflow.com/questions/8450539/images-taken-with-action-image-capture-always-returns-1-for-exifinterface-tag-or

what I do is i record the time when I'm starting the camera app from my app. THen on activity result I query the Media Provider to see if any pictures were saved after this timestamp I saved. That means that most likely OS saved the properly rotated..

Background service need to send GPS location on server

http://stackoverflow.com/questions/8095030/background-service-need-to-send-gps-location-on-server

Context.LOCATION_SERVICE Criteria c new Criteria c.setAccuracy Criteria.ACCURACY_COARSE final String PROVIDER lm.getBestProvider c true MyLocationListener new MyLocationListener lm.requestLocationUpdates PROVIDER 600000 0 MyLocationListener.. final String PROVIDER lm.getBestProvider c true MyLocationListener new MyLocationListener lm.requestLocationUpdates PROVIDER 600000 0 MyLocationListener Log.d LOC_SERVICE Service RUNNING Looper.loop catch Exception ex ex.printStackTrace LocationThread..

What are best practices for using AES encryption in Android?

http://stackoverflow.com/questions/8622367/what-are-best-practices-for-using-aes-encryption-in-android

import javax.crypto.spec.SecretKeySpec public class AdvancedCrypto implements ICrypto public static final String PROVIDER BC public static final int SALT_LENGTH 20 public static final int IV_LENGTH 16 public static final int PBE_ITERATION_COUNT.. iv IvParameterSpec ivspec new IvParameterSpec iv Cipher encryptionCipher Cipher.getInstance CIPHER_ALGORITHM PROVIDER encryptionCipher.init Cipher.ENCRYPT_MODE secret ivspec byte encryptedText encryptionCipher.doFinal cleartext.getBytes.. secret String encrypted throws CryptoException try Cipher decryptionCipher Cipher.getInstance CIPHER_ALGORITHM PROVIDER String ivHex encrypted.substring 0 IV_LENGTH 2 String encryptedHex encrypted.substring IV_LENGTH 2 IvParameterSpec ivspec..

OnLocationChanged callback is never called

http://stackoverflow.com/questions/9007600/onlocationchanged-callback-is-never-called

String s int i Bundle bundle Log.v TAG Status changed s public void onProviderEnabled String s Log.e TAG PROVIDER DISABLED s public void onProviderDisabled String s Log.e TAG PROVIDER DISABLED s My permissions in the AndroidManifest.. public void onProviderEnabled String s Log.e TAG PROVIDER DISABLED s public void onProviderDisabled String s Log.e TAG PROVIDER DISABLED s My permissions in the AndroidManifest uses permission android name android.permission.INTERNET uses permission.. as possible in order to troubleshoot. I would make your request look like requestLocationUpdates LocationManager.GPS_PROVIDER 0 0 locationListener requestLocationUpdates LocationManager.NETWORK_PROVIDER 0 0 locationListener This way you get ALL the..

Android Periodic GPS location updates with AlarmManager inside a Service

http://stackoverflow.com/questions/9869153/android-periodic-gps-location-updates-with-alarmmanager-inside-a-service

caught my eye when I run the code mLocationProvider mLocationManager.getBestProvider mCriteria true Log.i BEST PROVIDER IS mLocationProvider It says BEST PROVIDER IS gps. But this log inside onProviderEnabled is never shown in logcat. @Override.. mLocationManager.getBestProvider mCriteria true Log.i BEST PROVIDER IS mLocationProvider It says BEST PROVIDER IS gps. But this log inside onProviderEnabled is never shown in logcat. @Override public void onProviderEnabled String s.. Log.v onProviderEnabled ENABLED Two things to add if I use mLocationManager.requestLocationUpdates LocationManager.GPS_PROVIDER 0 0 mLocationListener it doesn't work either. This however works and I can get the LastKnownLocation Location lastKnown..