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

Comments: (0)

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

    momo <dunn74@gmail.com> Apr 30 08:02PM -0700  

    I've been looking at the source for several open-source image loaders, and
    am comparing the approaches. Looks like when processing the image data,
    most involve URL.openStream, but from there it looks like there are a
    couple different ways of decoding that stream to a Bitmap:
     
    1. URL.openStream, then BitmapFactory.decodeStream
    2. URL.openStream, then Drawable.createFromStream
    3. URL.openConnection().getInputStream() then convert to byteArray, then
    BitmapFactory.decodeByteArray
     
    I see there's a slight difference between #2 and the others - you get a
    Drawable, but you don't get to specify decoding or sampling, so this seems
    less preferable (you can always wrap the bitmap in BitmapDrawable later,
    and inPreferredConfig can be critical). Anything else?
     
    What about the difference between #1 and #3 - is there any benefit to
    converting to a byteArray first, then decoding that? And as regards the
    first part - is there any difference between URL.openStream and
    URl.openConnection().getInputStream()? They both just return the same
    InputStream, no?
     
    TYIA.

     

    Jonathan S <xfsunoles@gmail.com> Apr 30 02:59PM -0700  

    On Monday, April 30, 2012 11:58:13 AM UTC-4, Put_tiMe wrote:
    > "android.R.style.TextAppearance_StatusBar_EventContent"*, "style",
    > getPackageName());
     
    > How do I do this?
     
     
    That is not quite right for it,
     
    Are you using it for TextView?

     

    Put_tiMe <puttime@gmail.com> Apr 30 07:44PM -0700  

    No, I want to get the system's default text color used in the status bar
    notification.
     
    Is there anyway I can get this?
     
     
    On Tuesday, May 1, 2012 3:29:45 AM UTC+5:30, Jonathan S wrote:

     

    Mai Al-Ammar <mai.alammar@gmail.com> May 01 03:16AM +0300  

    Hello every one,
     
    I have a simple question about timer in Android, How can I know if the
    timer is stopped or not?
    I have an if statement which see if some condition is satisfied, then it
    will stop the timer by :
    if(timerTask != null)
    timerTask.cancel();
    I want to check after calling the timer if the timer is stopped or not?
     
    Please help me
     
    thanks in advance
     
    --
    Mai A. Al-Ammar
    Teacher Assistant
    Imam Mohammad bin Saud Islamic University
    College of Computer Science

     

    James Black <planiturthian@gmail.com> Apr 30 08:57PM -0400  

    I would create a remote service for the timer, and query it, since it would
    run independently from the activity.

     

    Mai Al-Ammar <mai.alammar@gmail.com> May 01 04:41AM +0300  

    Thank you but I don't understand what did you mean :(
     
     
     
    --
    Mai A. Al-Ammar
    Teacher Assistant
    Imam Mohammad bin Saud Islamic University
    College of Computer Science

     

    Agus <agus.santoso@gmail.com> Apr 30 05:27PM -0700  

    Is showing dialog from a dialog possible? (Not an activity that gets styled
    as a dialog.)
     
    -Agus.

     

    TreKing <trekingapp@gmail.com> Apr 30 08:16PM -0500  


    > Is showing dialog from a dialog possible? (Not an activity that gets
    > styled as a dialog.)
     
     
    What are you trying to do?
     
    -------------------------------------------------------------------------------------------------
    TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
    transit tracking app for Android-powered devices

     

    Adam Ratana <adam.ratana@gmail.com> Apr 30 04:54PM -0700  

    I think going with OpenGL is likely your best bet here. Further in the
    book he will have the OpenGL implementation of the same. There is also the
    excellent graphic library by the same, libgdx which you might also consider
    using. Another place to look is the replica island source - a fully
    implemented 2d game, and also look for the "sprite method test" which
    compares different methods of drawing sprites.
     
    You can indeed choose to only render parts of the screen that you consider
    dirty, which can also help with your performance, but likely you should be
    able to get the performance you want with just openGL, a texture atlas and
    drawing it all at once.
     
     
     
    On Sunday, April 29, 2012 12:00:45 PM UTC-4, realh wrote:

     

    "Tareq Al-Ma'mari" <tariq.mamari@gmail.com> May 01 01:12AM +0300  

    Hi ,
     
    How can I use and access a database file (.db) ?
    I've tried many ways but nothing works ,
    the problem is when I try to open a database file the application crashed ,
    so I've tried to check if the database file is exist :
     
    File database = context.getDatabasePath("maindb.db");
    database.exists(); // false
    database.getPath(); // this gives me the path
    data/data/MY_Package/databases/maindb.db
    database.isFile() ; // false
     
    //////
    this is my open command
    if(database.exists())
    {
    myDb=SQLiteDatabase.openDatabase(DB_NAME, null,
    SQLiteDatabase.NO_LOCALIZED_COLLATORS);
    }
     
    please I need help , I'm so tired ,
    I've been searching for a long time
     
    yours,
    Tareq

     

    baturanija1 <jadrankobodiroga1985@gmail.com> Apr 30 04:00PM -0700  

    HEY people, is there an option that i can mount\unmount SDK card to
    input in my app? Thanks for helping

     

    Mohamed ElSanousi <mmurtada57@gmail.com> May 01 01:01AM +0400  

    Oh ok. And how will I get the actual pixel dimensions of the screen? I
    really need your help
    Thanks
     

     

    Jim Graham <spooky130u@gmail.com> Apr 30 04:21PM -0500  

    On Tue, May 01, 2012 at 01:01:01AM +0400, Mohamed ElSanousi wrote:
    > > stretched either in width or height.
     
    > Oh ok. And how will I get the actual pixel dimensions of the screen? I
    > really need your help
     
    I hate to dissapoint you, but as I learned some time ago, you can't. No
    matter what you do, the image will always be stretched beyond the limits
    of the screen. That's just how Android does it. And if you're about to
    question that, I got this directly from Dianne Hackborn in a thread I
    started over a year ago (maybe two...I'm not even sure now).
     
    Later,
    --jim
     
    --
    THE SCORE: ME: 2 CANCER: 0
    73 DE N5IAL (/4) | Peter da Silva: No, try "rm -rf /"
    spooky130u@gmail.com | Dave Aronson: As your life flashes before
    < Running FreeBSD 7.0 > | your eyes, in the unit of time known as an
    ICBM / Hurricane: | ohnosecond.... (alt.sysadmin.recovery)
    30.44406N 86.59909W |
     
    Android Apps Listing at http://www.jstrack.org/barcodes.html

     

    Mohamed ElSanousi <mmurtada57@gmail.com> May 01 01:26AM +0400  

    Your joking, my whole project is depending. I need to resize this bitmap
    to fit the screen size, because I want to do calculation on the picture :(
     

     

    Justin Anderson <magouyaware@gmail.com> Apr 30 03:46PM -0600  


    > And if you're about to question that, I got this directly from Dianne
    > Hackborn in a thread I
    > started over a year ago (maybe two...I'm not even sure now).
     
    Do you happen to have a link to said thread? I have done image scaling
    before and have never run into this... My constraints were slightly
    different though... I simply scaled the image so that it was as large as
    possible while maintaining the aspect ration.
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     

     

    Justin Anderson <magouyaware@gmail.com> Apr 30 03:47PM -0600  


    > Your joking, my whole project is depending. I need to resize this bitmap
    > to fit the screen size, because I want to do calculation on the picture :(
     
    What kind of calculations are you doing? You should be able to do that
    without having to have the image fit the screen size.
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     

     

    Jim Graham <spooky130u@gmail.com> Apr 30 05:18PM -0500  

    One point here: the assumption I'm making is that this is for a
    wallpaper.
     
    On Mon, Apr 30, 2012 at 03:46:37PM -0600, Justin Anderson wrote:
    > > Hackborn in a thread I
    > > started over a year ago (maybe two...I'm not even sure now).
     
    > Do you happen to have a link to said thread?
     
    If I did, don't you think I'd be able to say how long ago it was? ;-}
    But given the source of the information---direct from one of THE
    Android developers (as in, the platform itself), I think it's safe to
    say that you're nuts if you don't listen to what she said.
     
    > constraints were slightly different though... I simply scaled the image
    > so that it was as large as possible while maintaining the aspect
    > ration.
     
    Yeah, and I tried all of that stuff, too....and no matter what, it kept
    getting stretched off-screen when you set it as wallpaper.
     
    > On Mon, Apr 30, 2012 at 3:26 PM, Mohamed ElSanousi <mmurtada57@gmail.com>wrote:
     
    > > Your joking, my whole project is depending. I need to resize this bitmap
    > > to fit the screen size, because I want to do calculation on the picture :(
     
    Wait a second...is this for a wallpaper (or lwp)? Or are you just trying
    to set an ImageView to full screen? If the former, no, you can't do it.
    If the latter, RTFM (http://developer.android.com/guide/index.html).
    That's so simple I never even considered that that's what you were
    asking. And you don't need to calculate the screen size or anything to
    do that. Just the right settings (in XML and maybe also in Java) for an
    ImageView.
     
    Later,
    --jim
     
    --
    THE SCORE: ME: 2 CANCER: 0
    73 DE N5IAL (/4) | "> There it was, right in the title bar:
    spooky130u@gmail.com | > Microsoft Operations POS."
    < Running FreeBSD 7.0 > |
    ICBM / Hurricane: | "Never before has a TLA been so appropriately
    30.44406N 86.59909W | mis-parsed." (alt.sysadmin.recovery)
     
    Android Apps Listing at http://www.jstrack.org/barcodes.html

     

    bob <bob@coolfone.comze.com> Apr 30 02:11PM -0700  

    Should you be in Debug mode to properly use this tracing functionality?
     
    // start tracing to "/sdcard/calc.trace"
    Debug.startMethodTracing("calc");
    // ...
    // stop tracing
    Debug.stopMethodTracing();
     
    Or, does it pretty much not matter?

     

    Tina Seaburn <tinamarieseaburn@gmail.com> Apr 30 01:31PM -0700  

    I'm a Windows Phone 7 Developer trying to learn enough about the
    android platform to port some apps onto android...
     
    In WP7 we have "Pivots" and "Panoramas" where a "page" may be 15
    pages wide and the user can slide them accross. The same Code Class
    handles them all so all of the variables are common. It makes
    navigation very simple for
    both the user and the programmer. Is there any
    such vehicle in Android?
     
    Maybe I could put a very wide page into a horizontal slider or
    something
    like that?
     
     
    Thanks so much for anyone that can help me with this.
    Tina

     

    Erik <erik@browne.name> Apr 30 01:28PM -0700  

    Could you use a LinearLayout and set the layout_weight of each custom view
    to 1?
     
    -Erik
     
    On Monday, April 30, 2012 4:10:33 AM UTC-7, JTeagle wrote:

     

    nguillot <nguillot@ippon.fr> Apr 30 12:16AM -0700  

    Anyone have an idea?
     
     

     

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

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

Comments: (0)

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

    Justin Anderson <magouyaware@gmail.com> Apr 30 12:53PM -0600  

    Are you putting the Bitmap in an ImageView?
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     

     

    Mohamed ElSanousi <mmurtada57@gmail.com> Apr 30 11:04PM +0400  

    No.
     

     

    Justin Anderson <magouyaware@gmail.com> Apr 30 01:10PM -0600  

    What exactly are you trying to accomplish? You said "the returned image is
    stretched and doesn't fit the mobile screen size" but I don't see anywhere
    in your code where you are doing anything with the screen size of the
    device... What exactly are you expecting and what exactly are you seeing?
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     

     

    Mohamed ElSanousi <mmurtada57@gmail.com> Apr 30 11:56PM +0400  

    I want the selected picture that is passed to the new activity to fit the
    screen size. I want to resize the bitmap to fit the screen exactly.
    Thanks
     

     

    Justin Anderson <magouyaware@gmail.com> Apr 30 02:16PM -0600  


    > I want the selected picture that is passed to the new activity to fit the
    > screen size. I want to resize the bitmap to fit the screen exactly.
     
    Well, then you would need some code to get the actual pixel dimensions of
    the screen... right now you have hardcoded values of 750. Keep in mind
    that doing this will cause distortion of the image... It will look
    stretched either in width or height.
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     

     

    ThomasWrobel <darkflame@gmail.com> Apr 30 01:13PM -0700  

    Ok, I am using a HTC Legend.
    The crashes didn't start when I started using the 3D, so I don't think
    its a specific command thats doing it. Maybe a OpenGL related memory
    leak.
     
    Anyway, using adb pull /proc/uptime I get
    65.94 18.30
     
    The phone takes a good 20 seconds to reload, most of the time spent on
    a HTC logo (first a static one for a long time, then it flashes and
    then a animated one for a shorter time)
     
    If its hardware related I guess there isnt too much I can do about it,
    but perhaps by figuring out the exact point it happens I can minimize
    its occurrences.
     
     

     

    Kristopher Micinski <krismicinski@gmail.com> Apr 30 02:53PM -0400  

    You aren't understanding... This might not work unless the phone has
    the proper service to grab it. Why don't you try using the similar
    client / server implementation for transferring files?
     
    kris
     

     

    "Jason Teagle" <teagle.jason@gmail.com> Apr 30 07:58PM +0100  

    (@Kristopher: The OP doesn't have access to the other device's application
    space - it's not a phone or tablet.)
     
     
    >electronic frame is supporting bluetooth. So do you know for example
    >how to send file any phone.my program giving error therefore uuid
     
    It seems you need to use something called the Object Push Profile, so hit
    your favourite search engine and start looking for information.
     
    This Q/A post may help:
     
    http://stackoverflow.com/questions/5577481/sending-a-file-using-bluetooth-obex-object-push-profile-opp
     
     
    Fair warning, I have read a lot of flak about Bluetooth file sending not
    working from [certain] phones so be prepared for a struggle.
     
    This has now become more of a question about coding Bluetooth Profiles
    rather than Android specifically, so perhaps this is no longer the place to
    ask. *Your* turn to do some research.

     

    Kristopher Micinski <krismicinski@gmail.com> Apr 30 03:32PM -0400  

    > (@Kristopher: The OP doesn't have access to the other device's application
    > space - it's not a phone or tablet.)
     
    I never saw this specified anywhere..
     
    kris

     

    "hüseyin toplu" <hsynnt@gmail.com> Apr 30 12:35PM -0700  

    i searched everywhere i read a lot of book about bluetooh so i ask
    you however thanks a lot
     

     

    Kristopher Micinski <krismicinski@gmail.com> Apr 30 03:47PM -0400  

    What's the name of the device you're trying to push to?
     
    kris
     

     

    Kristopher Micinski <krismicinski@gmail.com> Apr 30 03:34PM -0400  

    Except that a service runs in the main application thread by default,
    so even if you're running it in a service you'll still need a thread
    and some way to communicate with it.
     
    yes, using an AsyncTask would be an alternative, and what is typically
    done in these situations where you're waiting for data to load.
     
    Kris
     

     

    Rahul Vijay <rahul.vijay14@gmail.com> Apr 30 10:54PM +0530  

    > android-developers+unsubscribe@googlegroups.com
    > For more options, visit this group at
    > http://groups.google.com/group/android-developers?hl=en
     
    Go to vijayvargiyarahul.blogspot.in
    Give the example how to reading a file from SD Card

     

    Jonathan S <xfsunoles@gmail.com> Apr 30 12:17PM -0700  

    if you use lint tools, it will give you warning for hard-coded sdcard
    directory.
     
    On Monday, April 30, 2012 1:24:56 PM UTC-4, Rahul Vijay wrote:

     

    Justin Anderson <magouyaware@gmail.com> Apr 30 09:05AM -0600  

    It would be better to create a singleton manager class for managing
    settings for your app.
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     
    On Mon, Apr 30, 2012 at 8:53 AM, Daniel Drozdzewski <

     

    jadranko bodiroga <jadrankobodiroga1985@gmail.com> Apr 30 07:17PM +0200  

    ok..i have other question...i make code
     
    if (AppSettings.playSounds)
    {
    play.mp.start(); //////////play is a another class which i what to start
    music what i input in play-class
    }
     
     
     
    import android.app.Activity;
    import android.content.Context;
    import android.media.MediaPlayer;
    import android.os.Bundle;
    import android.view.View;
     
    public class play extends Activity{
     
    public static Context context;
    public static MediaPlayer mp=MediaPlayer.create(context,
    R.drawable.klik);
     
    }
     
     
    and shows an error..I can not recognize errorfrom logcat...What iam doing
    wrong?

     

    Justin Anderson <magouyaware@gmail.com> Apr 30 11:34AM -0600  

    Why are you holding onto a static Context reference? Your Activity IS a
    context. I have never done anything with MediaPlayer but I doubt it needs
    to be static either.
     
    and shows an error..I can not recognize errorfrom logcat...What iam doing
    > wrong?
     
    Telling us what the error is might be helpful...
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     
    On Mon, Apr 30, 2012 at 11:17 AM, jadranko bodiroga <
    jadrankobodiroga1985@gmail.com> wrote:
     

     

    "Jason Teagle" <teagle.jason@gmail.com> Apr 30 06:35PM +0100  

    (Bearing in mind the warning you were giving [by another member] about
    globals being evil, don't make *everything* static.)
     
     
    >public static Context context;
    >public static MediaPlayer mp=MediaPlayer.create(context, R.drawable.klik);
     
    Your error is probably that you declared an object called 'context' but
    didn't assign anything to it (it remains null) - an Activity is itself a
    Context, so 'this' is the usual way, I believe, but it needs to be in the
    constructor):
     
    public class play extends Activity{
     
    public static MediaPlayer mp= null ;
     
    public play()
    {
    if (mp == null) // The singleton instance not yet created.
    mp = MediaPlayer.create(this, R.drawable.klik);
     
    }

     

    Put_tiMe <puttime@gmail.com> Apr 30 08:58AM -0700  

    I want to retrieve the system's color value from a resource string, like:
     
    getResources().getIdentifier(*
    "android.R.style.TextAppearance_StatusBar_EventContent"*, "style",
    getPackageName());
     
     
     
    How do I do this?

     

    bsquared <bwcode4u@gmail.com> Apr 30 08:57AM -0700  

    Hello,
     
    I am looking for a remote keyboard solution for my android device
    preferable using adb shell or similar. Can anyone point me to some
    example code or app?
     
    Thank you,
     
    Regards,
    Brian

     

    Justin Anderson <magouyaware@gmail.com> Apr 30 09:49AM -0600  


    > Need help in inserting an image into a mysql database from android.
     
    You most likely would not want to do that... It would probably be better to
    store the image somewhere on the device and store the path to the image in
    the database.
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     

     

    Justin Anderson <magouyaware@gmail.com> Apr 30 09:41AM -0600  

    This is a list for developing android applications with the SDK. For
    support questions with your device you need to contact your manufacturer or
    service provider.
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     

     

    raja shekar <raja.androiddeveloper@gmail.com> Apr 30 08:48PM +0530  

    Make your own Images for your landscape mode . put those in drawable-land .
    when the orientation changes automatically reflects on screen.

     

    Yaron Reinharts <yaron.reinharts@gmail.com> Apr 30 05:40PM +0300  

    Hi,
     
    I'm trying to sample frames from a video.
    However, MediaMetadataRetriever.getFrameAtTime always returns the same
    frame (the first).
     
    I tried with some emulators (2.3.3 to 4.0.3) and some video formats
    (including mp4 and 3gp which should be supported according to
    documentation).
     
    Here is a test code (saveBitmapToFile works well in many other locations
    so I truest it).
     
    MediaMetadataRetriever retriever = new MediaMetadataRetriever();
    retriever.setDataSource(filePath);
    String value =
    retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION);
    long length = Long.parseLong(value);
     
    for(int i = 0; i < length; i += 200)
    {
    Bitmap bitmap = retriever.getFrameAtTime(i);
    saveBitmapToFile(bitmap, debugPath + i + ".jpg");
    }
     
     
    What am I doing wrong?
     
    By the way, it looks that I'm not the first one bumped into this problem
    http://stackoverflow.com/questions/10188938/how-to-get-the-frame-from-video-file-in-android
     
    Thanks in advance
    /Yaron
     
     
    --
    Yaron Reinharts
    Smart Drive Applications
    http://www.poncho.co.il/gateaway.php
    https://market.android.com/details?id=com.poncho.gsm.gate.activities

     

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

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

Comments: (0)

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

    Justin Anderson <magouyaware@gmail.com> Apr 30 09:51AM -0600  

    What have you tried so far? How are you loading the image?
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     

     

    Mohamed ElSanousi <mmurtada57@gmail.com> Apr 30 10:44PM +0400  

    Code:
    I have this code in the Activity result, when the user hits load, it will
    open the gallery allow him to choose a picture. The selected pictured is
    passed to another activity, here is where i'm facing the problem. The
    picture doesn't fit the screen.
     
     
    Uri selectedimage= data.getData();
     
    Uri contentUri = data.getData();
     
    String[] proj = { MediaStore.Images.Media.DATA };
     
    Cursor cursor = managedQuery(contentUri, proj, null, null, null);
     
     
    int column_index =
    cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
     
    cursor.moveToFirst();
     
    String tmppath = cursor.getString(column_index);
     
     
     
    Intent intent= new Intent(this,NasalProjectionActivity.class);
     
    intent.putExtra("imagePath",tmppath);
     
    startActivity(intent);
     
     
    Receiving Activity,
     
    Thats what i have on the receiving activity.
     
     
     
    Bitmap b = BitmapFactory.decodeFile(getIntent().getStringExtra(
    "imagePath"));
     
    int newHe=750;
     
    int newWe=750;
     
     
     
     
    int width=b.getWidth();
     
    int height = b.getHeight();
     
    float scaleWidth = ((float) newWe) / width;
     
    float scaleHeight = ((float) newHe) / height;
     
    Matrix matrix = new Matrix();
     
    matrix.postScale(scaleWidth, scaleHeight);
     
    Bitmap resizedBitmap = Bitmap.createBitmap(b, 0, 0, width, height,
    matrix, false);
     
    Thanks alot
     

     

    "Jason Teagle" <teagle.jason@gmail.com> Apr 30 03:45PM +0100  

    >nobody is not know anything about that :S
     
    If you keep saying that, people aren't going to bother answering you in
    future. If people had ideas, they would say so. People have already given
    you answers, but you rejected them.
     
    You can't just 'send a file to any device'. At the very least, assuming you
    find a phone willing to accept your attempt to connect, you need *something*
    on the other phone that is capable of accepting a file. Do you know what
    application on the target phone you are hoping to use, if not yours? You
    need to know its protocol, so that you can use it to correctly transmit the
    file. Why *can't* your app be on the target phone? It would probably make it
    a lot easier.
     
    What you are asking sounds dangerously like you want to spam people's phones
    (any within range) with unwanted files, so a quick explanation of *why* you
    want to do this might get a better response. Describe the application you
    have in mind - people might be able to suggest alternative ways.

     

    Kristopher Micinski <krismicinski@gmail.com> Apr 30 11:16AM -0400  

    I agree with Jason ..
     
    kris
     

     

    "hüseyin toplu" <hsynnt@gmail.com> Apr 30 10:43AM -0700  

    So i will use it send piture to electronic frame any ideas :S
     
    On Apr 30, 6:16 pm, Kristopher Micinski <krismicin...@gmail.com>
    wrote:

     

    "Jason Teagle" <teagle.jason@gmail.com> Apr 30 06:56PM +0100  

    >So i will use it send piture to electronic frame any ideas :S
     
    That may not be possible. From what I have seen through Googling, the target
    device needs to have
     
    "File Transfer Profile" (OBEX FTP) and/or the "Object Push Profile" (OBEX
    OPP) Bluetooth services
     
    enabled. For a phone, this may be possible - but assuming you mean some
    non-phone device (Android or otherwise), it's unlikely that they would
    support something like that unless they are specifically *designed* to
    support Bluetooth transfer of files.

     

    "hüseyin toplu" <hsynnt@gmail.com> Apr 30 11:39AM -0700  

    electronic frame is supporting bluetooth. So do you know for example
    how to send file any phone.my program giving error therefore uuid
     

     

    Thomas Wrobel <darkflame@gmail.com> Apr 30 07:46PM +0200  

    I am using XP/eclipse. I see all the normal logs coming from the
    device just fine, including many,many I put in my apps code.
     
    On searching for adb on my system it seems all I found is a polite
    note from google saying its been moved too
    "platform-tools/" in my android sdk directory.
    As that directory is not in my sdk directory, it tells me too install
    "Android SDK Platform-tools" which I will try now and post back in a
    bit.
     
    This is really odd to me though, as I thought adb was an essential
    part not a optional addon. Apparently ddsm.bat and logcat seem to be
    able to run without it though.
     

     

    Chris Stratton <cs07024@gmail.com> Apr 30 11:26AM -0700  

    > I also use the JPCT 3D library in my app, as well as using the camera
    > preview as a background, so the app is pretty heavy overall.
     
    My first hunch would be issues in the platform openGL implementation
    that probably uses.
     
    It would be worth doing some web searching on the phone model - it's
    possible others have found the same issue.
     
    Also you may want to figure out if you are getting a kernel reboot, or
    an android runtime framework crash & restart while the kernel
    continues running. Once you get adb working, look in /proc/uptime
    shortly after a crash - if it's a low number of seconds, your kernel
    rebooted, if it's a high number likely just the framework crashed and
    restarted. (You'll probably also see a bootloader splash screen after
    a power-on or kernel reboot, before the more lengthy startup animation
    that runs while the android runtime framework gets itself going.)
     
    It goes without saying, that if the platform is working as intended,
    there is nothing an app can do to cause a reboot, so the fact that it
    is happening means something is broken with the device/android build.

     

    ThomasWrobel <darkflame@gmail.com> Apr 30 11:27AM -0700  

    Ok, that seemed to help. Installing the Platform-tools seemed to put
    the adb.exe where It should be.
    Dumping the log to a file the last entries I see are:
     
    D/dalvikvm( 1241): GC_FOR_MALLOC freed 10098 objects / 483816 bytes in
    152ms
    W/System.err( 1241): java.security.KeyStoreException: KeyStore jks
    implementation not found
    W/System.err( 1241): at
    java.security.KeyStore.getInstance(KeyStore.java:134)
    W/System.err( 1241): at
    org.jivesoftware.smack.ServerTrustManager.<init>(ServerTrustManager.java:
    70)
    W/System.err( 1241): at
    org.jivesoftware.smack.XMPPConnection.proceedTLSReceived(XMPPConnection.java:
    824)
    W/System.err( 1241): at
    org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:
    267)
    W/System.err( 1241): at org.jivesoftware.smack.PacketReader.access
    $000(PacketReader.java:43)
    W/System.err( 1241): at org.jivesoftware.smack.PacketReader
    $1.run(PacketReader.java:70)
    V/libgps ( 104): DeferredActionThread pthread_cond_wait returned
    D/RPC ( 104): written RPC packet size: [24]
    D/RPC ( 104): read RPC packet
    D/RPC ( 104): read RPC packet size: [284]
    V/libgps ( 104): DeferredActionThread pthread_cond_wait returned
    D/RPC ( 104): written RPC packet size: [24]
    D/RPC ( 104): read RPC packet
    D/RPC ( 104): read RPC packet size: [284]
    V/libgps ( 104): DeferredActionThread pthread_cond_wait returned
    D/RPC ( 104): written RPC packet size: [24]
    D/RPC ( 104): read RPC packet
    D/RPC ( 104): read RPC packet size: [284]
    V/libgps ( 104): DeferredActionThread pthread_cond_wait returned
    D/RPC ( 104): written RPC packet size: [24]
     
     
    I am going to try cross referencing this with the Dalvik Debug Monitor
    a few times too see if I really am getting more out of the saving too
    file method VS just looking in the GUI.
    I am a little skeptical I am seeing the real reason, as I would
    expect the very last messages to be the ones causing the crash, rather
    then a few more debug/normal stuff and then a hardware restart.
     

     

    "Jason Teagle" <teagle.jason@gmail.com> Apr 30 06:11PM +0100  

    >And...why doesn't Froyo support what is clearly listed as supported
    >since API level 1 in the dev guide? They should agree, shouldn't they?
     
    Be aware that they might mean that the *original* enum (16 values) was
    available from level 1, but that the ADD and OVERLAY additions may not have
    existed until, say, level 8. It could simply be worded badly, giving the
    wrong impression.
     
    How does what you expect ADD to do differ from a combination such as, say,
    SRC_OVER (in the images shown at
    http://softwyer.wordpress.com/2012/01/21/1009/, 'SrcOver' looks like we're
    seeing the yellow circle through the grey square as it it were tinted glass,
    which was my understanding of what you wanted - how is ADD different)?
     
     
    --
    Jason Teagle
    jason.teagle@yahoo.co.uk

     

    Jim Graham <spooky130u@gmail.com> Apr 30 12:30PM -0500  

    On Mon, Apr 30, 2012 at 01:18:43PM -0400, Mark Murphy wrote:
     
    > ADD, SCREEN, and OVERLAY were added in API Level 11. I filed an issue
    > regarding the documentation gap:
     
    > http://code.google.com/p/android/issues/detail?id=29823
     
    Ok, thanks for clearing that up. I understand now. I never considered
    that the dev guide might be wrong. I've always understood, from this
    list, that it is *THE* reference. Of course, I saw an example in the
    camera sample page (.../guide/topics/media/camera.html) it shows great
    examples such as "catch (Exception e)" which, I gather, is REALLY BAD....
    So I shouldn't be too surprised.
     
    But again, how would I duplicate that mode without PorterDuff?
     
    Thanks,
    --jim
     
    --
    THE SCORE: ME: 2 CANCER: 0
    73 DE N5IAL (/4) MiSTie #49997 < Running FreeBSD 7.0 >
    spooky130u@gmail.com ICBM/Hurr.: 30.44406N 86.59909W
     
    No, I'm not going to explain it. If you can't figure it
    out, you didn't want to know anyway... --Larry Wall
     
    Android Apps Listing at http://www.jstrack.org/barcodes.html

     

    Raghav Sood <raghavsood@gmail.com> Apr 30 11:04PM +0530  

    Depending on how many files the code is spread across, you could pick up
    the newer code from the Android source and incorporate it into your app,
    and call that. It might get too messy if there is too much code though.
     
    Thanks
     
     
    --
    Raghav Sood
    https://market.android.com/developer?pub=Appaholics
    http://www.appaholics.in/

     

    Jim Graham <spooky130u@gmail.com> Apr 30 12:36PM -0500  

    On Mon, Apr 30, 2012 at 06:11:02PM +0100, Jason Teagle wrote:
     
    > we're seeing the yellow circle through the grey square as it it were
    > tinted glass, which was my understanding of what you wanted - how is
    > ADD different)?
     
    I tried lots of modes, including SRC_OVER. Imagine the following two
    filters: the first is a solid color blue filter; the second is a fog
    filter (graduated, upwards from the bottom)[1]. Every other method I
    tried did some combination of showing only one filter or the other
    where they overlapped, or where they did NOT overlap. That is *NOT*
    correct. ADD shows both, where they overlap and where they don't.
     
    Later,
    --jim
     
     
    [1] a combination useful for turning a bright, sunny day into a foggy
    moonlit night, from which you can get really creative. :-)
     
    --
    THE SCORE: ME: 2 CANCER: 0
    73 DE N5IAL (/4) MiSTie #49997 < Running FreeBSD 7.0 >
    spooky130u@gmail.com ICBM/Hurr.: 30.44406N 86.59909W
     
    No, I'm not going to explain it. If you can't figure it
    out, you didn't want to know anyway... --Larry Wall
     
    Android Apps Listing at http://www.jstrack.org/barcodes.html

     

    Jim Graham <spooky130u@gmail.com> Apr 30 12:44PM -0500  

    On Mon, Apr 30, 2012 at 01:35:34PM -0400, Mark Murphy wrote:
    > > But again, how would I duplicate that mode without PorterDuff?
     
    > Beats me -- I'd follow Jason's advice. To me, PorterDuff is a line of
    > dark beer from The Simpsons... :-)
     
    Nah, that would be Duff Porter. :-)
     
    And see my followup to Jason about the differences.... ADD is the only
    one I found that properly mimicks how photographic filters work. And
    Raghav's suggestion, to incorporate the code (e.g., from API 11), leads
    me to visions of dependencies on other API 11 code, which then depends
    on other ..... ad nauseum. I could be wrong, but.... Is the math for
    adding the colors simple enough? Or does it quickly turn into an
    absolute nightmare? Note that I haven't done anything beyond simple
    math since college (where we had to know how to use and derive
    Maxwell's Equations ... I don't even remember ANY of that now).
     
    Later,
    --jim
     
    --
    THE SCORE: ME: 2 CANCER: 0
    73 DE N5IAL (/4) MiSTie #49997 < Running FreeBSD 7.0 >
    spooky130u@gmail.com ICBM/Hurr.: 30.44406N 86.59909W
     
    No, I'm not going to explain it. If you can't figure it
    out, you didn't want to know anyway... --Larry Wall
     
    Android Apps Listing at http://www.jstrack.org/barcodes.html

     

    "Jason Teagle" <teagle.jason@gmail.com> Apr 30 06:43PM +0100  

    >tried did some combination of showing only one filter or the other
    >where they overlapped, or where they did NOT overlap. That is *NOT*
    >correct. ADD shows both, where they overlap and where they don't.
     
    Sorry to be persistent... but according to the image in that link I gave
    SRC_OVER should show everything - the portion of the source outside of the
    overlap, the portion of the destination outside of the overlap, and the
    overlap area blended.
     
    Could you perhaps show us a similar set of images for all modes available,
    but using your sample filters, so we can see how it differs?
     
    Also, that article mentions a possible bug with hardware acceleration:
     
    http://code.google.com/p/android/issues/detail?id=22361
     
    Hopefully that is not the cause of your woes?

     

    Jim Graham <spooky130u@gmail.com> Apr 30 12:50PM -0500  

    On Mon, Apr 30, 2012 at 06:43:58PM +0100, Jason Teagle wrote:
     
    > Could you perhaps show us a similar set of images for all modes
    > available, but using your sample filters, so we can see how it
    > differs?
     
    It'll take a little while, but yeah, I'll post a few.
     
    Later,
    --jim
     
    --
    THE SCORE: ME: 2 CANCER: 0
    73 DE N5IAL (/4) | Tux (E Cat): DS B+Wd Y 6 Y L+++ W+ C++/C++ I+++
    spooky130u@gmail.com | T++ A E H+ S V- F++ Q+++ P/P+ B++ PA+ PL SC---
    < Running FreeBSD 7.0 > |
    ICBM / Hurricane: | Tiggerbelle: DS W+S+Bts % 1.5 X L W C+++/C+
    30.44406N 86.59909W | I+++ T A E++ H S++ V+++ Q+++ P B++ PA++ PL+ SC
     
    Android Apps Listing at http://www.jstrack.org/barcodes.html

     

    Jim Graham <spooky130u@gmail.com> Apr 30 01:23PM -0500  

    On Mon, Apr 30, 2012 at 06:11:02PM +0100, Jason Teagle wrote:
     
    > we're seeing the yellow circle through the grey square as it it were
    > tinted glass, which was my understanding of what you wanted - how is
    > ADD different)?
     
    It would appear that ADD (Saturate(S+D)) and SRC_OVER
    ([Sa + (1 - Sa)*Da,Rc=Sc+(1-Sa)*Dc]) are, in fact, identical (for my
    purposes, anyways), despite the differences in the math. I must have
    missed this one before (that happens...cancer #1 blah blah blah). Why
    they use different math, I don't know (or care). But it works. No
    exclusion like the modes I tried (though I thought for sure I'd tried
    SRC_OVER ... guess not).
     
    And with that, I'm heading back to the code...I'm happy to be finished
    wasting time on this bit. :-)
     
    Thanks,
    --jim
     
    --
    THE SCORE: ME: 2 CANCER: 0
    73 DE N5IAL (/4) | Tux (E Cat): DS B+Wd Y 6 Y L+++ W+ C++/C++ I+++
    spooky130u@gmail.com | T++ A E H+ S V- F++ Q+++ P/P+ B++ PA+ PL SC---
    < Running FreeBSD 7.0 > |
    ICBM / Hurricane: | Tiggerbelle: DS W+S+Bts % 1.5 X L W C+++/C+
    30.44406N 86.59909W | I+++ T A E++ H S++ V+++ Q+++ P B++ PA++ PL+ SC
     
    Android Apps Listing at http://www.jstrack.org/barcodes.html

     

    momo <dunn74@gmail.com> Apr 30 11:15AM -0700  

    I have to believe there's a way to clear image data from memory once it's
    no longer required, but despite exhaustive searching I can't find a
    solution. Both this list and stack are full of questions regarding OOM
    errors, specifically "bitmap size exceeds VM budget", but I still don't see
    a clear answer.
     
    I understand there are hard memory limits on devices, and I understand it's
    not realistic to load up and display or cache large amounts of image data,
    but there should be away to discard data that's no longer required.
     
    For example, imagine this very basic hypothetical app, that emulates a lot
    of the behavior of the native gallery app:
     
    1. An image gallery that allows the user to peruse images from a remote
    server.
    2. There might be any number of images on that server.
    3. The app displays 1 image at a time, and allows a user to go back or
    forward 1 image at a time through button presses or swiping.
    4. There'd be a maximum of 3 images rendered at any one time (so the user
    can see the one immediately to the left or right of the current image when
    swiping). All other image data should be discarded.
    5. Images are loaded using URL.openStream and Drawable.createFromStream or
    BitmapFactory.decodeStream. Streams are closed appropriately.
    6. Images are sized appropriately *on the server* before being fetched.
    7. Loading happens in AsyncTasks. Tasks that are no longer needed (due to
    moving away from an image with an incomplete task) are cancelled. Any
    references in the AyncTask are WeaklyReferenced.
    8. When any image is no longer required, it's "cleared" via:
    A) getBackground().setCallback(null)
    B) Listeners are set to null
    C) setImageDrawable/Bitmap(null)
    D) removeView
     
    This simple construct, that takes into account all the suggest practices
    I'm aware of, will inevitably crash with an OOM error at some point. Using
    BitmapFactory.Options inSampleSize and inPreferredConfig will delay the
    inevitable, but not forever, and at the cost of image quality. In this
    example, I've used remote images, but the issue exists with images stored
    in /assets/ or in internal memory, etc.
     
    My feeling is that if we can display X amount of image data at one point,
    and we take all steps to remove that image data from memory, we should be
    able to display that same amount of data later, without having to
    compensate for what has happened before.
     
    With the sheer quantity of questions about this very issue, I'd hope to
    have a standard solution documented, but if there is one, I can't find it.
    I've seen answers posted by Romain Guy, who otherwise seems very generous
    with his knowledge and active in the community, that say something like
    "Simple. Don't use so much memory". OK. Tell me how.
     
    Am I missing something fundamental? Is there a way to discard image data
    once it's no longer being used? What is missing from the above to create a
    simple photo gallery? Assuming the built-in gallery app uses the FW, I
    imagine there has to be a way...
     
    TYIA.

     

    Fred Rischter <fredrischter@gmail.com> Apr 30 10:51AM -0700  

    Hi!
     
    Yesterday I have released a demo-draft of a new game that we are
    developing.. this is Dead House, about survival horror theme (and of
    course, the name refers to other known game, not by coincidence), download
    at this url:
     
    https://play.google.com/store/apps/details?id=com.fredrischter.deadhouse.free
     
    I'm posting here to ask for any critics on the game, if somebody have any
    suggestion or find a bug will be very appreciated.. Also thank for comments
    there and rating :D
     
    Thanks a lot!
    Fred

     

    "Jason Teagle" <teagle.jason@gmail.com> Apr 30 03:49PM +0100  

    >is there any option that i can declare public variable-
    >such as int,and to be seen in other class in my other activity.When i
     
    This would normally be done by using a static boolean / int in a class
    designed simply for holding 'global' data.
     
    public class AppSettings
    {
    public static boolean playSounds = true ;
     
    }
     
    Now any class should be able to access it:
     
    AppSettings.playSounds = false ;
     
    if (AppSettings.playSounds)
    // do something.
     
    etc.

     

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

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

Comments: (0)

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

    Jim Graham <spooky130u@gmail.com> Apr 30 10:33AM -0500  

    Here's some additional logcat data. The following is what I'm betting
    is the most applicable data. The rest (minus stuff like network,
    telephony, battery levels, etc.) is attached in a zip. It seems that
    as soon as I start the app, dalvikvm is griping about not recognizing
    the PorterDuff mode ADD.
     
    --------------------------- CUT HERE ---------------------------
    Right after the app starts.....
     
    I/ActivityManager(1321): Start proc com.jdgapps.UltraCamPro
    for activity com.jdgapps.UltraCamPro/.UltraCamPro:
    pid=24675 uid=10151 gids={1006, 1015}
     
     
    The following two entris also show up in the same spot for the app from
    the book---same entry numbers and table number, along with two others
    (entries 0x7f040006 and 0x7f040005), but I have no idea what they mean.
     
     
    04-30 09:29:59.811 W/ResourceType(1321): Skipping entry 0x7f040007 in
    package table 0 because it is not complex!
    04-30 09:29:59.819 W/ResourceType(1321): Skipping entry 0x7f040008 in
    package table 0 because it is not complex!
     
     
    D/dalvikvm(24675): DexOpt: couldn't find static field
    W/dalvikvm(24675): VFY: unable to resolve static field 3 (ADD)
    in Landroid/graphics/PorterDuff$Mode;
    D/dalvikvm(24675): VFY: replacing opcode 0x62 at 0x0022
    D/dalvikvm(24675): VFY: dead code 0x0024-002d in
    Lcom/jdgapps/UltraCamPro/UltraCamPro;
    .mergeBitmaps (Landroid/graphics/Bitmap;
    Landroid/graphics/Bitmap;
    II)Landroid/graphics/Bitmap;
    04-30 09:30:00.405 D/dalvikvm(1157): GC_EXPLICIT freed 2 objects /
    64 bytes in 105ms
    D/LibSOCKobeCamera(1158): +openCameraHardware
     
     
    Then, the UI opens: I/LibSOCKobeCamera(1158): Preview is running.
     
    And I add a couple of filters:
     
     
    D/dalvikvm(24675): GC_EXTERNAL_ALLOC freed 900 objects / 68496 bytes in 55ms
    I/LibSOCKobeCamera(1158): Preview is running.
    D/dalvikvm(1409): GC_FOR_MALLOC freed 13127 objects / 525536 bytes in 108ms
    D/dalvikvm(24675): GC_EXTERNAL_ALLOC freed 470 objects / 22344 bytes in 54ms
    D/dalvikvm(24675): GC_EXTERNAL_ALLOC freed 24 objects / 1040 bytes in 43ms
     
     
    When I add the second one, BAM!
     
     
    D/AndroidRuntime(24675): Shutting down VM
    W/dalvikvm(24675): threadid=1: thread exiting with uncaught exception
    (group=0x400208b0)
    E/AndroidRuntime(24675): FATAL EXCEPTION: main
    E/AndroidRuntime(24675): java.lang.NoSuchFieldError:
    android.graphics.PorterDuff$Mode.ADD
    E/AndroidRuntime(24675): at com.jdgapps.UltraCamPro.UltraCamPro.
    mergeBitmaps(UltraCamPro.java:1236)
    E/AndroidRuntime(24675): at com.jdgapps.UltraCamPro.UltraCamPro.
    processFilterSelection(UltraCamPro.java:1319)
     
    [lots more stuff tracing back to the ListView and its nuts & guts...see
    zip for this stuff]
     
    W/ActivityManager(1321): Force finishing activity
    com.jdgapps.UltraCamPro/.UltraCamPro
    --------------------------- CUT HERE ---------------------------
     
    Does this help at all?
     
    Thanks,
    --jim
     
    --
    THE SCORE: ME: 2 CANCER: 0
    73 DE N5IAL (/4) MiSTie #49997 < Running FreeBSD 7.0 >
    spooky130u@gmail.com ICBM/Hurricane: 30.44406N 86.59909W
     
    Do not look into waveguide with remaining eye.
     
    Android Apps Listing at http://www.jstrack.org/barcodes.html

     

    "Jason Teagle" <teagle.jason@gmail.com> Apr 30 04:45PM +0100  

    Call me suspicious, but in their own example at
     
    http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/Xfermodes.html
     
    they don't use either ADD or OVERLAY, but do list the remaining 16 from the
    PorterDuff enum:
     
    private static final Xfermode[] sModes = {
    new PorterDuffXfermode(PorterDuff.Mode.CLEAR),
    new PorterDuffXfermode(PorterDuff.Mode.SRC),
    new PorterDuffXfermode(PorterDuff.Mode.DST),
    new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER),
    new PorterDuffXfermode(PorterDuff.Mode.DST_OVER),
    new PorterDuffXfermode(PorterDuff.Mode.SRC_IN),
    new PorterDuffXfermode(PorterDuff.Mode.DST_IN),
    new PorterDuffXfermode(PorterDuff.Mode.SRC_OUT),
    new PorterDuffXfermode(PorterDuff.Mode.DST_OUT),
    new PorterDuffXfermode(PorterDuff.Mode.SRC_ATOP),
    new PorterDuffXfermode(PorterDuff.Mode.DST_ATOP),
    new PorterDuffXfermode(PorterDuff.Mode.XOR),
    new PorterDuffXfermode(PorterDuff.Mode.DARKEN),
    new PorterDuffXfermode(PorterDuff.Mode.LIGHTEN),
    new PorterDuffXfermode(PorterDuff.Mode.MULTIPLY),
    new PorterDuffXfermode(PorterDuff.Mode.SCREEN)
    };
     
    I remember someone said it was available as of 2.2 or something like that,
    but it's almost as if it's been deprecated for some reason.

     

    Jim Graham <spooky130u@gmail.com> Apr 30 10:59AM -0500  

    On Mon, Apr 30, 2012 at 04:45:58PM +0100, Jason Teagle wrote:
    > };
     
    > I remember someone said it was available as of 2.2 or something like
    > that, but it's almost as if it's been deprecated for some reason.
     
    That looks like the list that Eclipse gave, too. But, when you look at
    the developers guide (android.graphics.PorterDuff.Mode), ADD and OVERLAY
    are also listed. I THOUGHT they were also listed in the book, but I just
    checked, and they aren't. So the only place I saw them was the
    developers guide (which I understand to be *THE* reference). It doesn't
    say anything about those modes being deprecated...just that they've been
    available since API Level 1. But I'm starting to believe that either
    the dev. guide is wrong on this one.
     
    On to the next response that just came in.....
     
    Later,
    --jim
     
    --
    THE SCORE: ME: 2 CANCER: 0
    73 DE N5IAL (/4) MiSTie #49997 < Running FreeBSD 7.0 >
    spooky130u@gmail.com ICBM/Hurricane: 30.44406N 86.59909W
     
    "Someone ever tries to kill you, you try to kill 'em right back!"
    --Mal (Firefly, 1x03, Our Mrs. Reynolds)
     
    Android Apps Listing at http://www.jstrack.org/barcodes.html

     

    Jim Graham <spooky130u@gmail.com> Apr 30 11:10AM -0500  

    On Mon, Apr 30, 2012 at 11:55:41AM -0400, Mark Murphy wrote:
    > to me, and I don't mean the log output. At this point, I have no idea
    > what is and is not working for you, other than an indication that
    > perhaps your ADD problem persists.
     
    Sorry, but I'm not understanding this any better, myself.
     
    I'll try to simplify it a bit, though.
     
    ADD works perfectly on my tablet (was HONEYCOMB, now ICS). It blends the
    filter(s) and the image exactly as it should to simulate glass filters in
    front of a 35mm SLR.
     
    ADD works in the example from Pro Android Media on my phone (Froyo).
     
    ADD does NOT work, using the exact same 4 or 5 lines of code (different
    variables) in my app on my phone. It force closes claiming that the ADD
    mode does not exist. The developer's guide
    (in android.graphics.PorterDuff.Mode), however, clearly lists it. The
    description is given as "Saturate(S + D)" and states that PorterDuff.Mode
    has been available since API Level 1. No mention is made anywhere on
    that page of anything being deprecated or only available since some point
    after API 1. It should work. I can't find any indication of any other
    problems...no out of memory error for the small images taken by my
    phone's camera, no hint of other errors. Just a force close saying there
    is no such field as "ADD" for PorterDuff.
     
    That's what's got me so confused. And the use of the filters in my app
    relies on that, too.
     
    Does that help clear up the source of confusion? Or does that just
    confuse it further?
     
    Later,
    --jim
     
    --
    THE SCORE: ME: 2 CANCER: 0
    73 DE N5IAL (/4) MiSTie #49997 < Running FreeBSD 7.0 >
    spooky130u@gmail.com ICBM/Hurricane: 30.44406N 86.59909W
     
    "Someone ever tries to kill you, you try to kill 'em right back!"
    --Mal (Firefly, 1x03, Our Mrs. Reynolds)
     
    Android Apps Listing at http://www.jstrack.org/barcodes.html

     

    Jim Graham <spooky130u@gmail.com> Apr 30 11:39AM -0500  

    One more detail: in my app, if I replace ADD with MULTIPLY, it works on
    my phone, too (but doesn't do what I need like ADD does). That would
    seem to indicate that it's not the surrounding code, but a problem with
    ADD.
     
    Later,
    --jim
     
    --
    THE SCORE: ME: 2 CANCER: 0
    73 DE N5IAL (/4) MiSTie #49997 < Running FreeBSD 7.0 >
    spooky130u@gmail.com ICBM/Hurr.: 30.44406N 86.59909W
     
    No, I'm not going to explain it. If you can't figure it
    out, you didn't want to know anyway... --Larry Wall
     
    Android Apps Listing at http://www.jstrack.org/barcodes.html

     

    Jim Graham <spooky130u@gmail.com> Apr 30 12:02PM -0500  

    On Mon, Apr 30, 2012 at 12:35:45PM -0400, Mark Murphy wrote:
    > > mode does not exist.
     
    > Clearly, *something* is different between those apps. targetSdkVersion
    > or build target would by my two best guesses.
     
    There is. Eclipse built the version of the book code from my directory,
    (which I imported from) and not tne one that it copied to my workspace.
    The one in my directory still had MULTIPLY mode, not ADD. So I changed
    it, and set both the min-sdk and target sdk to Android 2.2. Even with
    all three PorterDuff imports, it still won't build at all, saying that
    ADD is not a valid field...directly contradicting the developers guide,
    which makes even less sense to me than before.
     
     
    So now, a new question: since PorterDuff's ADD method is clearly not
    going to work on all APIs that I want to support, how do I duplicate
    that method of adding bitmaps (one being a photo from the camera, the
    other being a semi-transparent color filter, just like glass filters on
    a 35mm SLR camera)?
     
    And...why doesn't Froyo support what is clearly listed as supported
    since API level 1 in the dev guide? They should agree, shouldn't they?
     
    Thanks,
    --jim
     
    --
    THE SCORE: ME: 2 CANCER: 0
    73 DE N5IAL (/4) MiSTie #49997 < Running FreeBSD 7.0 >
    spooky130u@gmail.com ICBM/Hurr.: 30.44406N 86.59909W
     
    No, I'm not going to explain it. If you can't figure it
    out, you didn't want to know anyway... --Larry Wall
     
    Android Apps Listing at http://www.jstrack.org/barcodes.html

     

    dillipk <codersnet2010@gmail.com> Apr 30 09:16AM -0700  

    Hi,
    My App should read the properties like (IP address/Port No..etc)
    from CONFIG or Property file that already exists in the device and
    connect to the server based on the info. This way, anybody can edit
    the IP Address/Port no info available in the property file.
     
     
    - Is it possible to package the pre-configured property file as part
    of APK file so that it can create in the device during it's
    installation?
     
     
    I read through SharePreferences android provides.. but as I
    understood, the sharedpereferences can ONLY be created/accessed when
    the App is running.
     
    - Is there anyway, the App can create the activity_preferences.xml
    during it's installation, so that, the Properties would already be
    available when you run the App.?
     
     
    OR, what is the best approach for this requirement?
     
    Thanks in advance..
     
    Regards,
    DK

     

    Michael Banzon <michael@banzon.dk> Apr 30 06:19PM +0200  

    Why can't you create the preference file as the very first thing when
    running the app the first time?
     
    Or maybe hard code the values?
     
     
    --
    Michael Banzon
    http://michaelbanzon.com/

     

    dillipk <codersnet2010@gmail.com> Apr 30 09:44AM -0700  

    Thanks for the response..
     
    I do not want any hard code. As per my requirement, the App should
    already read the server details( IP Adress/Port No) at the first time
    run also. Later the user can edit activity_preferences.xml to change
    the IP address/Port if required..
     
    Thanks,
    DK
     

     

    Michael Banzon <michael@banzon.dk> Apr 30 06:50PM +0200  

    I understand that you don't want any hard coded values - but isn't
    that the same as including a pre-defined setting?
     
    You could have some predefined values and write them to the settings
    file if it doesn't exist and then let the user change them as she
    likes.
     
     
    --
    Michael Banzon
    http://michaelbanzon.com/

     

    Nadeem Hasan <nhasan@nadmm.com> Apr 30 09:44AM -0700  

    Stats are only updated overnight and are very erratic at times.

     

    Justin Anderson <magouyaware@gmail.com> Apr 30 10:42AM -0600  

    Start by developing your app... Then when you have a specific problem,
    other than "help me to build this application," come back and try again.
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     
    On Mon, Apr 30, 2012 at 1:08 AM, Siddharth Chopra

     

    Pent <support@apps.dinglisch.net> Apr 30 07:52AM -0700  

    I've only ever (in over two years) seen reboots caused by changes made
    via the wifi manager API. If you're using it, I would start there.
     
    Pent

     

    Robert Greenwalt <rgreenwalt@google.com> Apr 30 08:00AM -0700  

    You can do a logcat before the crash, logging to a file. Perhaps then
    you'll get a better view of what happened before.
     
    A post-crash bugreport may also have a copy of the previous kernel log if
    it's a kernel issue.
     
    R
     

     

    ThomasWrobel <darkflame@gmail.com> Apr 30 08:34AM -0700  

    Thanks for the replys. I am afraid I am ignorant of how to do that.
    So far I have just been using the Dalvik Debug Monitor, I can see
    options to save to a file, but not to log to a file continuously.
    Googleing around seems to infer I need to put code in my app to send
    the log to a file on the SD card, or use a Debugging library. Is this
    correct?
    Also, where is the bugreport located?
     
    Poly - I have nothing in my own code that effects the wifi manager
    API. However, I am using aSmack lib for XMPP communications that could
    do that. It doesn't seem too consistent though, as the crashes happen
    sometimes before I logon to a server.
    I suspect it might be ram related in some way, as the crashs are very
    inconsistent. Sometimes it crashes as soon as it loads, other times I
    can use it for a few minutes before crashing.
    I also use the JPCT 3D library in my app, as well as using the camera
    preview as a background, so the app is pretty heavy overall.
     
    Thanks again,
    Thomas
     

     

    Robert Greenwalt <rgreenwalt@google.com> Apr 30 09:41AM -0700  

    I don't know your environment, but you should have access to adb.
     
    adb logcat
     
    starts capturing some of the available debug streams. To write it to a
    file:
    adb logcat > mylog.txt
    or to log to file and to screen (on linux):
    adb lgocat | tee mylog.txt
     
    This will only record stuff from some of the log streams, but it defaults
    to the common ones. If you think your app is strictly to blame you can put
    in log statements there too, but crashes should be logged for you.
     
    adb bugreport > mybugreport.txt will capture the last buffers from all the
    streams and much much more.
     
    R

     

    Justin Anderson <magouyaware@gmail.com> Apr 30 10:39AM -0600  


    > Would code snippets be ok to post here?
     
    I don't see how anyone would be able to help you without them...
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     

     

    Justin Anderson <magouyaware@gmail.com> Apr 30 10:38AM -0600  


    > I'm developing an application that requires accessing the cantacts
    > stored on the device then accesing their picture
     
    Cool, thanks for letting us know...
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     

     

    Justin Anderson <magouyaware@gmail.com> Apr 30 10:37AM -0600  

    I have used TextPaint in the past and have not run into this problem. The
    only major differences I see between your code and mine is that I am not
    specifying a font, and I am setting the stroke width to a value of 1.
     
    What happens if you use the default font and/or specify a stroke width?
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     

     

    Justin Anderson <magouyaware@gmail.com> Apr 30 09:50AM -0600  

    Umm... what does your code look like?
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     

     

    Rudolf Polzer <rudolf.polzer@i-r-p.de> Apr 30 09:27AM -0700  

    I want to get some details from the contacts.
    This is how I do it, contact selection works fine,
    but getting the contact details works only for some of the contacts:
     
     
    // ---------------- select one of the contacts
    -----------------------------------------------------------------
    c = mContentResolver.query(ContactsContract.Contacts.CONTENT_URI, null,
    null, null, ContactsContract.Contacts.DISPLAY_NAME + " COLLATE LOCALIZED
    ASC");
    while(c.moveToNext()) // show all contacts

    displayNames.add(c.getString(c.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME)));
    int index = ... // select one of the contacts
    c.moveToPosition(index);
    String contactId =
    c.getString(c.getColumnIndex(ContactsContract.Contacts._ID));
    // ---------------- get given name
    -----------------------------------------------------------------
    c = getContentResolver().query(ContactsContract.Data.CONTENT_URI,
    new
    String[]{ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME},
    ContactsContract.Data.CONTACT_ID + " = " + contactId, null, null);
    if(c.moveToPosition(1))
    String givenName =
    c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.GIVEN_NAME));
    // ---------------- get family name
    -----------------------------------------------------------------
    c = getContentResolver().query(ContactsContract.Data.CONTENT_URI,
    new
    String[]{ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME},
    ContactsContract.Data.CONTACT_ID + " = " + contactId, null, null);
    if(c.moveToPosition(1))
    String familyName =
    c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME));
    // ---------------- get company name
    -----------------------------------------------------------------
    c = getContentResolver().query(ContactsContract.Data.CONTENT_URI,
    new String[]{ContactsContract.CommonDataKinds.Organization.COMPANY},
    ContactsContract.Data.CONTACT_ID + " = " + contactId, null, null);
    if(c.moveToPosition(2))
    String Company =
    c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.Organization.COMPANY));
    // ---------------- get mobile phone number
    ------------------------------------------------------
    c = getContentResolver().query(ContactsContract.Data.CONTENT_URI,
    new String[]{ContactsContract.CommonDataKinds.Phone.NUMBER},
    ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = " + contactId,
    null, null);
    if(c.moveToPosition(1))
    String mobilePhoneNumber =
    c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
    // ---------------- get email address
    -----------------------------------------------------------------
    c = getContentResolver().query(ContactsContract.Data.CONTENT_URI,
    new String[]{ContactsContract.CommonDataKinds.Email.ADDRESS},
    ContactsContract.CommonDataKinds.Email.CONTACT_ID +" = "+ contactId,
    null, null);
    if(c.moveToPosition(3))
    String eMailAddress =
    c.getString(c.getColumnIndex(ContactsContract.CommonDataKinds.Email.ADDRESS));
     
     
    Those "if(c.moveToPosition(...))" are strange, but seem necessary.
    Any ideas to make this work reliably?

     

    Robert Greenwalt <rgreenwalt@google.com> Apr 30 09:12AM -0700  

    To route through hipri you will need to call requestRouteToHost, specifying
    the hipri network type and the ip addr of the host you're trying to reach.
     

     

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