[android-developers] Digest for android-developers@googlegroups.com - 25 Messages in 12 Topics

Group: http://groups.google.com/group/android-developers/topics

    Giuseppe <porcelli.giuseppe@gmail.com> Dec 30 11:51AM -0800  

    I have created a PendingIntent with AlarmManager that send an email every
    minute with following code:
     
    public void SetAlarm(Context context) {
    AlarmManager am = (AlarmManager)
    context.getSystemService(Context.ALARM_SERVICE);
    Intent i = new Intent(context, Backup_Email_Receiver.class);
    PendingIntent pi = PendingIntent.getBroadcast(context, 0, i, 0);
    am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), 1000 *
    60 * 1, pi);
    }
     
    and now I am trying to remove it using:
     
    public void CancelAlarm(Context context) {
    Intent intent = new Intent(context, Backup_Email_Receiver.class);
    PendingIntent sender = PendingIntent.getBroadcast(context, 0, intent, 0);
    AlarmManager alarmManager = (AlarmManager)
    context.getSystemService(Context.ALARM_SERVICE);
    alarmManager.cancel(sender);
    }
     
    But there is no way to delete it !!!!
    I am getting crazy as I have tried in any way, please any help before I
    wipe the device ?
     
    Also I have create this Pending Intent in different situation, like a Unit
    Test and from a service, and I have already tried to delete it using the
    same system, but no way.

     

    "G. Blake Meike" <blake.meike@gmail.com> Dec 30 12:28PM -0800  

    That's odd... the cancel really should work. You need an intent that is
    identical to the one you are trying to cancel. It looks as if that's what
    you've got. Is it possible that you've scheduled multiple but slightly
    different alarms, while developing?
     
    Uninstalling the app that scheduled the alarm should get rid of it.
     
    G. Blake Meike
    Marakana
     
    Programming Android 2ed is now in stores:
    http://bit.ly/programmingandroid
     
     
    On Sunday, December 30, 2012 11:51:06 AM UTC-8, Giuseppe wrote:

     

    Giuseppe <porcelli.giuseppe@gmail.com> Dec 30 12:54PM -0800  

    I have uninstalled the app and the unit test app too, no way alarm is still
    there.
    I have also dump the alarm from adb, my pendingIntent is not there.
     
    I am starting to get crazy

     

    Adam Ratana <adam.ratana@gmail.com> Dec 30 10:08AM -0800  

    Hello, I'm hoping someone can answer this question: Why are some languages
    available on some devices, but not others, even while running the latest
    version of Android?
     
    I've been fortunate to have some users do a few translations of my app, and
    2 of the languages, Turkish and Afrikaans are present on certain tablets,
    but maybe not on others, or on certain phones. For example, the Nexus 4
    and Nexus 7 do not have Afrikaans support, but the Nexus 10 does.
     
    Because these are Nexus devices, variables such as carrier skinning and
    manufacturer skinning/custom OS builds are out of the question, so I'm
    wondering if anyone can answer what the reason may be? I don't really have
    a satisfactory answer, nor could I find one by searching. For the person
    who did the Afrikaans translation, he can only enjoy it on his tablet, but
    not his phone. This also doesn't seem to change with OS upgrades.

     

    Mark Murphy <mmurphy@commonsware.com> Dec 30 01:21PM -0500  

    > Hello, I'm hoping someone can answer this question: Why are some languages
    > available on some devices, but not others, even while running the latest
    > version of Android?
     
    Because languages take up space, so device manufacturers typically
    only ship the languages of relevance for where they intend to market
    the device.
     
    > Because these are Nexus devices, variables such as carrier skinning and
    > manufacturer skinning/custom OS builds are out of the question
     
    Not really. Google presumably negotiates with device manufacturers on
    all sorts of features based upon costs and such. Which languages to
    support would be one of those features.
     
    --
    Mark Murphy (a Commons Guy)
    http://commonsware.com | http://github.com/commonsguy
    http://commonsware.com/blog | http://twitter.com/commonsguy
     
    In questi siti web puoi chiedere o rispondere a domande relative allo
    sviluppo di applicazioni Android: http://www.andglobe.com

     

    Adam Ratana <adam.ratana@gmail.com> Dec 30 01:37PM -0500  


    > Not really. Google presumably negotiates with device manufacturers on
    > all sorts of features based upon costs and such. Which languages to
    > support would be one of those features.
     
    Interesting, but I suppose this makes sense. It's frustrating to Android
    adopters who live in countries where some devices support their native
    language and others do not.
     
    I've noticed with iOS that the languages supported are the languages
    supported, period, which is a win on the consistency side. The same
    consistency across "pure google" devices would be nice and ensure consumer
    confidence in some of these presumably smaller markets, but I'm preaching
    to the choir here.
     
    I suppose that short of an official answer from someone at Google, this
    will have to do. Thanks Mark.

     

    "Zxanatos C. Omyda" <omydazx1@gmail.com> Dec 30 01:31PM -0500  

    Thank you so very much!
     
    Zxanatos Carsten Omyda
    OmydaZX1@gmail.com
    Http://Omyda.com

     

    Nobu Games <dev.nobu.games@gmail.com> Dec 30 07:48AM -0800  

    I just checked the implementation of (Simple)CursorAdapter. Calling
    swapCursor with argument null (instead of another cursor object) internally
    calls notifyDataSetInvalidated. That is basically a "death sentence" for an
    Adapter and signals to the ListView it belongs to that the data source
    should not be used anymore.
     
    Why it seems to still be working erratically after setting a different
    cursor object might have to do with an internal bug in ListView and its
    view caching strategies. You just triggered a sequence of events that is
    undefined or not allowed to happen in the framework.
     
    So you have three options:
     
    1. Don't call swapCursor(null)
    2. If you want the ListView to be blank then call listView.setAdapter(null)
    3. Or temporarily let Adapter.getCount() return 0 and call
    notifyDataSetChanged until the new cursor is loaded.
     
     
    On Wednesday, December 19, 2012 9:23:25 PM UTC-6, Evan Ruff wrote:

     

    Nobu Games <dev.nobu.games@gmail.com> Dec 30 07:34AM -0800  

    There is no Android-SDK-specific solution for a page curl effect. However,
    if you would search Google for "Android page curl effect" then you would
    immediately see that other people already implemented something for you.
     
    On Sunday, December 30, 2012 3:52:56 AM UTC-6, laxman k wrote:

     

    Jim Duda <jim@duda.tzo.com> Dec 30 10:32AM -0500  

    On 12/29/2012 11:52 PM, Jonathan S wrote:
     
    > <intent
    > android:targetPackage="com.example.android.misterhouse.activity"
    > android:targetClass="SettingsActivity" /
     
    I tried that one too. I get the same error. I guess I have to start
    digging into sources/android.
     
    Regards,
    Jim
     

     

    AndroidCompile <androidcompile@gmail.com> Dec 30 06:04AM -0800  

    Hi,
    Can anyone recommend a way to compress a 2 color Bitmap? (preferably a
    lossless one)
     
    I suppose I should use RGB_565 (I am currently using ARGB) , but other
    than that, what should give me the best compression ratio? (JPEG, PNG,...)
    Should I think of my own compression algorithm for this?

     

    Nobu Games <dev.nobu.games@gmail.com> Dec 30 07:26AM -0800  

    You can store your bitmap as a palette-based PNG with 2 colors. As far as I
    know the PNG format allows lossless run-length encoding compression.
     
    If you really want to implement your own data format then the simplest
    approach would be a file header with image width and height, 6 bytes for
    the two RGB color definitions for your two colors, followed by a sequence
    of pixel bytes. Each byte encodes 8 sequential pixels from your bitmap
    where a set bit represents one color and an unset bit the other.
    If you want to go fancy you could RLE-encode the sequence of pixels but
    then you might as well store the image as a palette-based PNG.
     
    On Sunday, December 30, 2012 8:04:33 AM UTC-6, AndroidCompile wrote:

     

    sebouh00 <sebouh00@gmail.com> Dec 30 03:24AM -0800  

    On my galaxy nexus, I created a simple app which displays the current
    altitude. My observation of the result shows that the altitude is
    increasing and then decreasing again throughout the day.
     
    I am not seeking the actual altitude, so using PRESSURE_STANDARD_ATMOSPHERE
    is sufficient for my needs.
     
    Regarding the result, my guess is that as the temperature changes outside,
    the reading is changing as well. So this leads me to the questions:
     
    1. How can I get a constant reading throughout the day? Should I use a
    reference pressure that changes as well?
    2. If so, is there a service on the web which gives me real time sea-level
    pressure values for locations around the world? The API doc says I can get
    a reading from a nearby airport, but that would mean I have to change this
    reference every time I move to a new region?
     
    Thanks.

     

    Todd Grigsby <tgrigsby777@gmail.com> Dec 30 03:45AM -0800  

    You can't use a barometer to accurately determine altitude. Air pressure
    changes almost continuously for a variety of meteorological reasons. What
    level of accuracy were you expecting?

     

    Mark Murphy <mmurphy@commonsware.com> Dec 30 07:35AM -0500  

    > You can't use a barometer to accurately determine altitude. Air pressure
    > changes almost continuously for a variety of meteorological reasons.
     
    Over a period of few minutes, you can. The XOOM was the first device
    with a barometer IIRC, and I definitely recall presentations by (now
    former) MOTODEV staff discussing tests they ran using parking garages,
    and how the XOOM nailed the height change fairly well.
     
    Over a period of hours or longer, though -- such as what the OP's
    trying to do -- you are spot on. Weather will have a substantial
    impact on barometric pressure.
     
    --
    Mark Murphy (a Commons Guy)
    http://commonsware.com | http://github.com/commonsguy
    http://commonsware.com/blog | http://twitter.com/commonsguy
     
    In questi siti web puoi chiedere o rispondere a domande relative allo
    sviluppo di applicazioni Android: http://www.andglobe.com

     

    sebouh00 <sebouh00@gmail.com> Dec 30 05:14AM -0800  

    I would like to save the altitude in my app and use it to check if the
    device is at the same altitude in the future. Using GPS will not be
    applicable because of minimal power usage restrictions in my app.
     
    Would it be possible to do such a thing? I don't care about the altitude
    value being correct, as long as it is the same (almost same... i can work
    with ranges) at the same location all the time.
     
    Thanks.
     
    On Sunday, December 30, 2012 3:35:41 PM UTC+3, Mark Murphy (a Commons Guy)
    wrote:

     

    Mark Murphy <mmurphy@commonsware.com> Dec 30 09:05AM -0500  

    > I would like to save the altitude in my app and use it to check if the
    > device is at the same altitude in the future. Using GPS will not be
    > applicable because of minimal power usage restrictions in my app.
     
    What tests have you run to determine that the barometer is
    sufficiently lower power than the GPS radio? I suspect it is, but I
    have never tried testing the scenario.
     
    > Would it be possible to do such a thing?
     
    IMHO, not reliably. If you are trying to get altitude accuracy +/- 500
    meters or so, perhaps.
     
    http://en.wikipedia.org/wiki/Atmospheric_pressure
    http://en.wikipedia.org/wiki/Altimeter
     
    Moreover, none of this has anything to do with Android, and it smacks
    of premature optimization, unless you have already implemented the
    GPS-based solution and proven that the power consumption is over your
    budget.
     
    --
    Mark Murphy (a Commons Guy)
    http://commonsware.com | http://github.com/commonsguy
    http://commonsware.com/blog | http://twitter.com/commonsguy
     
    In questi siti web puoi chiedere o rispondere a domande relative allo
    sviluppo di applicazioni Android: http://www.andglobe.com

     

    sebouh00 <sebouh00@gmail.com> Dec 30 06:50AM -0800  

    Wouldn't I need a lock on the GPS location in order to get the altitude? I
    would assume that would take more time, hence more power then just using
    the barometer.
     
    What about the altitude apps. How do they usually determine the approximate
    altitude. Do they suffer from +/- 500 meter inaccuracy?
     
    I don't have any experience with this, that's why I'm asking here.
     
    Thanks.
     
    On Sunday, December 30, 2012 5:05:12 PM UTC+3, Mark Murphy (a Commons Guy)
    wrote:

     

    Brad Stintson <geek.binary@gmail.com> Dec 30 07:53PM +0530  

    Hi,
     
    How to use google authentication to use an android application?
     
    Regards,
    Brad

     

    lbendlin <lutz@bendlin.us> Dec 30 04:10AM -0800  

    Take the Parrot Asteroid as an example. The user may have forgotten to plug in the USB GPS and/or the 3G dongle. So you want to ask the user to check the physical connections.

     

    Mark Murphy <mmurphy@commonsware.com> Dec 30 07:30AM -0500  

    > I guess when "best" returns NULL it really means there ain't
    > nothing available to satisfy my request.
     
    Ignoring the double negative, you are correct. getBestProvider() will
    progressively relax constraints you specified in your Criteria to try
    to give *something*, but if it does so and there are still no matches,
    you get null.
     
    > That was really the core of my question.
     
    TreKing's list seems pretty good.
     
    You can add "screwball device that doesn't meet the CDD/CTS but has a
    pirated version of the Play Store on it anyway" as another
    possibility. I've seen reports of weird stuff related to locations
    (and maps) with such devices. However, this is a fringe case, unless
    you're specifically trying to distribute to such devices.
     
    > If "best" returns NULL I have
    > to assume that I cannot determine the location - and then do something
    > accordingly.
     
    Yup. Popping a dialog that leads the user over to the Location portion
    of Settings seems to be a popular option, figuring that the issue is
    that the user has providers disabled. I get caught by that a fair bit,
    as I keep GPS disabled on my personal phone unless I am actively
    trying to use it. Occasionally, I'll try to get into Google
    Navigation, and it will yelp because I have GPS disabled.
     
    --
    Mark Murphy (a Commons Guy)
    http://commonsware.com | http://github.com/commonsguy
    http://commonsware.com/blog | http://twitter.com/commonsguy
     
    In questi siti web puoi chiedere o rispondere a domande relative allo
    sviluppo di applicazioni Android: http://www.andglobe.com

     

    "Carlos A. M. dos Santos" <unixmania@gmail.com> Dec 30 09:24AM -0200  


    > $ uname -a
    > Linux karma 3.5.0-21-generic #32-Ubuntu SMP Tue Dec 11 18:51:59 UTC 2012
    > x86_64 x86_64 x86_64 GNU/Linux
     
    From http://developer.android.com/sdk/installing/index.html
     
    "If you are running a 64-bit distribution on your development machine,
    you need to install the ia32-libs package using apt-get::
     
    apt-get install ia32-libs"
     
    --
    "The flames are all long gone, but the pain lingers on"

     

    gran33 <ran@sds-digitalradio.com> Dec 30 02:55AM -0800  

    Hey all,
     
    Does Android support any generic Bluetooth BLE profile? e.g GATT (Generic
    Attribute Profile)
     
    10x in advance,
    RAN

     

You received this message because you are subscribed to the Google Group android-developers.
You can post via email.
To unsubscribe from this group, send an empty message.
For more options, visit this group.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en