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

Comments: (0)

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

    Ankita Kashyap <ankita.kashyap.dce@gmail.com> Mar 30 05:40PM +0530  

    In case you are working with emulator:
    1) Go to Settings>Applications
    2) find your app there and click on it
    3) uninstall it
     
    and, re-run your application
     
     

     

    John Gaby <jgaby@gabysoft.com> Mar 30 07:03AM -0700  

    If you are using the emulator, you can change the size of the internal
    storage by adding the following command line argument when you launch
    the emulator:
     
    -partition-size 200
     

     

    santhosh b <santhoshb.android@gmail.com> Mar 31 02:13AM +0530  

    In Eclipse, go to "run Configurations". You can find that by right clicking
    on your project and click on "Run" and then "Run Configurations". Select
    "target", and select a preferred emulator target to launch. Then under
    "additional emulator command line options," add this:
     
    -partition-size 1024
     
    then click on apply and run.
    thanks,
    santhosh
     

     

    Davy <ddewaele@gmail.com> Mar 30 01:42PM -0700  

    Hi,
     
    I'm getting pretty terrible results when running the major web based
    frameworks (jQueryMobile,Sencha,JQtouch,....) on Android.
    Seems on ICS things are even worse than on earlier versions.
     
    This is the performance I'm seeing with jQueryMobile when pushing a button
    (extremely laggy on ICS) :
     
    http://www.youtube.com/watch?v=MbtUc0L_UUA
     
    css3 animations are also performing really really badly. On iOS everything
    is running pretty smoothly.
     
    There are also lots of issues in the Android bugtracker regarding
    html5/css3/javascript performance.
     
    Is there something I'm missing ? Something that needs to be done /
    configured in order to make those work ? Some guidelines we need to follow ?
     
    We're evaluation several web based frameworks as an alternative to some of
    the native development we're doing , but from what we're seeing, these
    things simply don't run well in Android at all (quality / performance is so
    low that some people in the team are considering dropping Android support
    completely).
     
    Regards,
    Davy

     

    Jimmy <falnatsha@gmail.com> Mar 30 01:31PM -0700  

    I have an application that shows images to the user in viewPager. My app
    cache about 150 MB per day and every day will double the size. I know
    Android will take care of deleting the app cache if its low in space but
    they emphasis on handling it by yourself but how ? Should I :
     
    1- Check the cache size every time the app wants to add an image (seems
    like an overkill since you have to loop over all the files to get the cache
    size).
    2- Not use a size limit and just free my app cache on next application
    start. (if the user didn't open the app the data will be there until the OS
    decide to remove it)
    3- Creating a repeated alarm every day to check and clear the cache (it
    looks like a waste battery)
     
    What a good Approach to handel the issue and if you managed caching in your
    app what was your flow ?
     
    Thanks
     
    You should always maintain the cache files yourself and stay within a
    reasonable limit of space consumed, such as 1MB.
     
     
    What i want to do is to cache the images into the desk and im wondering
    what a good Approach to manage caching in Android.
     
    Now my app cache about 150 MB per day and every day will double the size
    now as start i think

     

    bob <bob@coolfone.comze.com> Mar 30 11:23AM -0700  

    Does anyone know of a reasonable way to play Flash files in an Android app
    that does not require the installation of the Adobe Flash Player plug-in?

     

    Chris Stratton <cs07024@gmail.com> Mar 30 01:15PM -0700  

    On Friday, March 30, 2012 2:41:29 PM UTC-4, Mark Murphy (a Commons Guy)
    wrote:
    > > Does anyone know of a reasonable way to play Flash files in an Android
    > app
    > > that does not require the installation of the Adobe Flash Player plug-in?
     
    There have been some attempts at open source alternative players for flash
    content on the desktop, the porting of which might be attempted. How
    workable they currently are, I'm not sure, but their existence would seem
    to invalidate the "by definition" claim.
     
    One might still conclude it is not pragmatically possible to achieve
    sufficient compatibility for general use, or even if it were that it would
    not be worth the effort.
     

     

    Phil Bayfield <mail@phil.io> Mar 30 08:47PM +0100  

    I'm using a ViewPager with ListViews inside them but the transitions are
    quite jumpy.
     
    Can anyone tell me a good way to improve the performance of this?
     
    Thanks
    Phil

     

    JacekSt <jaceks@post.pl> Mar 30 12:19PM -0700  

    setRequestedOrientation( ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE );
     
     

     

    Nadeem Hasan <nhasan@nadmm.com> Mar 30 07:04AM -0700  

    And that too yes. Good catch. I did see the two layouts but was too focused
    on the issue reported.

     

    Nadeem Hasan <nhasan@nadmm.com> Mar 30 07:07AM -0700  

    As it has already been pointed, there are several things wrong with that
    small piece of code. You should go back and read more about listviews in
    Android.

     

    Walaa Mahmoud <walaamahmoud65@gmail.com> Mar 30 06:50PM +0200  

    Yeah Firstly this code is not original listview code as you said but i
    worked around the original code to figure out a way to make listview update
    only current row not previous rows , i read that i could use adapter.add()
    so it will add row one by one so will not update previous and that what i
    want .
     

     

    Anirudh Loya <loya.anirudh@gmail.com> Mar 30 05:00PM +0530  

    Ralph,
     
    He needs URL and the title after Parsing. very much doable with XML parsing.
     
    On Fri, Mar 30, 2012 at 4:46 PM, Ralph Bergmann | the4thFloor.eu <
     
    --
     
    Thank you****
     
    Anirudh Loya | Android Developer**
     
    Desk: +9140-30681824 | Mobile: +91*9246561265*
     
    *Love your Job but don't Love your company, Because you may not know when
    your company stops loving you.-- Voice Of Love*

     

    Bozzified <bozidar@gmail.com> Mar 30 09:36AM -0700  

    So I did make it work but feel free to pitch in and tell me if this is
    efficient or proper way.. I'm getting results fine with this
     
    *try* {
     
    DocumentBuilderFactory factory = DocumentBuilderFactory.*newInstance*();
     
    DocumentBuilder builder = factory.newDocumentBuilder();
     
     
    Document doc = builder.parse(feedURL);
     
    doc.getDocumentElement().normalize();
     
     
    // get xml document root element
     
    Element root = doc.getDocumentElement();
     
     
    // get node list of all elements with tag name item
     
    NodeList items = root.getElementsByTagName("Song");
     
     
    ArrayList<String[]> musicSet = *new* ArrayList<String[]>();
     
     
    *for* (*int* i = 0; i < items.getLength(); i++) {
     
     
    Node itemNode = items.item(i);
     
     
    *if* (itemNode.getNodeType() == Node.ELEMENT_NODE) {
     
     
    Element itemsAsElement = (Element) itemNode;
     
     
    Node _musicid=(Node) itemsAsElement.getElementsByTagName("musicid").item(
    0).getChildNodes().item(0);
     
    Node _asin=(Node) itemsAsElement.getElementsByTagName("ASIN").item(0).
    getChildNodes().item(0);
     
    Node _songname=(Node) itemsAsElement.getElementsByTagName("songname").item
    (0).getChildNodes().item(0);
     
    Node _albumname=(Node) itemsAsElement.getElementsByTagName("albumname").
    item(0).getChildNodes().item(0);
     
    Node _albumurl=(Node) itemsAsElement.getElementsByTagName("albumurl").item
    (0).getChildNodes().item(0);
     
    Node _albuminfo=(Node) itemsAsElement.getElementsByTagName("albuminfo").
    item(0).getChildNodes().item(0);
     
    Node _cover=(Node) itemsAsElement.getElementsByTagName("cover").item(0).
    getChildNodes().item(0);
     
    Node _isfree=(Node) itemsAsElement.getElementsByTagName("isfree").item(0).
    getChildNodes().item(0);
     
    Node _ringurl=(Node) itemsAsElement.getElementsByTagName("ringurl").item(0
    ).getChildNodes().item(0);
     
    Node _songurl=(Node) itemsAsElement.getElementsByTagName("songurl").item(0
    ).getChildNodes().item(0);
     
     
    String musicid=_musicid==*null* ? "N/A" : _musicid.getNodeValue();
     
    String asin=_asin==*null* ? "N/A" : _asin.getNodeValue();
     
    String songname=_songname==*null* ? "N/A" : _songname.getNodeValue();
     
    String albumname=_albumname==*null* ? "N/A" : _albumname.getNodeValue();
     
    String albumurl=_albumurl==*null* ? "N/A" : _albumurl.getNodeValue();
     
    String albuminfo=_albuminfo==*null* ? "N/A" : _albuminfo.getNodeValue();
     
    String cover=_cover==*null* ? "N/A" : _cover.getNodeValue();
     
    String isfree=_isfree==*null* ? "N/A" : _isfree.getNodeValue();
     
    String ringurl=_ringurl==*null* ? "N/A" : _ringurl.getNodeValue();
     
    String songurl=_songurl==*null* ? "N/A" : _songurl.getNodeValue();
     
     
    itemData = *new* String[] { musicid, asin, songname, albumname, albumurl,
    albuminfo, cover, isfree, ringurl, songurl };
     
    musicSet.add(itemData);
     
     
    }
     
    }
     
     
     
    *return* musicSet;
     
     
     
    On Thursday, March 29, 2012 10:04:44 AM UTC-7, Bozzified wrote:

     

    Bozzified <bozidar@gmail.com> Mar 30 09:37AM -0700  

    Btw that's a different xml now but it's the same thing I needed
     
    is there a better way to do that maybe?

     

    Chris Stratton <cs07024@gmail.com> Mar 30 09:14AM -0700  

    Since devices on mobile networks generally can't be reached by incoming
    connections, you will probably have to have a server somewhere which all
    the mobile clients check in with so it can forward traffic between them
    (possible using C2DM to get their attention).
     
    You will have to build functionality into the app running on each device so
    that it can accept requests for db operations from the server.
     
    Do think about the privacy, battery life, and data plan limit/charges
    implications of what you are building.
     
    On Friday, March 30, 2012 4:15:09 AM UTC-4, Kirupa wrote:

     

    sblantipodi <perini.davide@dpsoftware.org> Mar 30 07:06AM -0700  

    Hi, I'm working with coverflow, the images are displayed and working
    fine in android 2.3.6 and below versions but is not displayenter image
    description hereed properly in android 4.0 and above sub versions.
     
    No exception is thrown unfortunantly, the image, simply does not
    display correctly on android 4.

     

    sblantipodi <perini.davide@dpsoftware.org> Mar 30 08:51AM -0700  

    Ok I fixed the library, now it works.
     

     

    Rikki <tteam007@gmail.com> Mar 30 07:57AM -0700  

    I need to mix two animations between my activity switching.
     
    I already have slide-in/out left/right animations in place but I want
    to give a effect of Z-axis bounce to the new activity coming in focus.
     
    It should look give the following effect: When next activity is
    called, current activity is slide out with new activity head to head
    and the new activity should be 80% of the original while sliding in to
    the focus. When new activity is on the screen, it should zoom out to
    120% and immediately resize to 100%
     
    so the effect should look like a bounce effect towards z axis after
    slide animation is finished.
     
    Here is some of my code.
     
    Main activity
     
    public void onClickPrev(View view) {
    Intent intent = new Intent(this, SecondActivity.class);
    startActivityForResult(intent, 1);
    overridePendingTransition(R.anim.slide_in_left,
    R.anim.slide_out_right);
    }
    public void onClickNext(View view) {
    Intent intent = new Intent(this, SecondActivity.class);
    startActivityForResult(intent, 2);
    overridePendingTransition(R.anim.slide_in_right,
    R.anim.slide_out_left);
    }
    @Override
    protected void onActivityResult(int requestCode, int resultCode,
    Intent data) {
    if(requestCode == 1)
    overridePendingTransition(R.anim.slide_in_left,
    R.anim.slide_out_right);
    if(requestCode == 2)
    overridePendingTransition(R.anim.slide_in_right,
    R.anim.slide_out_left);
    }
    Second activity code
     
    public void onClickPrev(View view) {
    Intent intent = new Intent(this,
    TransitionAnimationActivity.class);
    startActivityForResult(intent, 1);
    overridePendingTransition(R.anim.slide_in_left,
    R.anim.slide_out_right);
    }
    public void onClickNext(View view) {
    Intent intent = new Intent(this,
    TransitionAnimationActivity.class);
    startActivityForResult(intent, 2);
    overridePendingTransition(R.anim.slide_in_right,
    R.anim.slide_out_left);
    }
    @Override
    protected void onActivityResult(int requestCode, int resultCode,
    Intent data) {
    if(requestCode == 1)
    overridePendingTransition(R.anim.slide_in_left,
    R.anim.slide_out_right);
    if(requestCode == 2)
    overridePendingTransition(R.anim.slide_in_right,
    R.anim.slide_out_left);
    }
    slide_in_left.xml
     
    <set xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="false">
    <translate android:duration="200" android:fromXDelta="-100%"
    android:fromYDelta="0%" android:toXDelta="0%"
    android:toYDelta="0%" />
    slide_in_right.xml
     
    <set xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="false">
    <translate android:duration="200" android:fromXDelta="100%"
    android:fromYDelta="0%" android:toXDelta="0%"
    android:toYDelta="0%" />
    slide_out_left.xml
     
    <set xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="false">
    <translate android:duration="200" android:fromXDelta="0%"
    android:fromYDelta="0%" android:toXDelta="-100%"
    android:toYDelta="0%" />
    slide_out_right.xml
     
    <set xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="false">
    <translate android:duration="200" android:fromXDelta="0%"
    android:fromYDelta="0%" android:toXDelta="100%"
    android:toYDelta="0%" />

     

    Nadeem Hasan <nhasan@nadmm.com> Mar 30 06:56AM -0700  

    I have a free app and been seeing a marked reduction in daily installs for
    a few days.

     

    Mark Murphy <mmurphy@commonsware.com> Mar 30 07:09AM -0400  


    > Recent Android versions (starting with 2.3, AFAICT) appear to have the
    > default to keep WiFi on at all times, including when the phone goes to
    > sleep.
     
    Y'know, I had not ever consciously thought about the fact that I
    hadn't been seeing the old "WiFi spinup when waking up the device with
    the power button" as much as before.
     
    > If that's the case for a particular device, you can just not worry about
    > this.
     
    Do you know how we detect this? Or is it purely by OS version? I can't
    find anything in the Settings app to control this timeout, and I don't
    recall seeing anything in the SDK about it (though it's not like I
    have been looking).
     
    Thanks!
     
    --
    Mark Murphy (a Commons Guy)
    http://commonsware.com | http://github.com/commonsguy
    http://commonsware.com/blog | http://twitter.com/commonsguy
     
    _The Busy Coder's Guide to *Advanced* Android Development_ Version 2.5
    Available!

     

    Kostya Vasilyev <kmansoft@gmail.com> Mar 30 04:24PM +0400  

    30.03.2012 15:09, Mark Murphy написал:
     
    > Y'know, I had not ever consciously thought about the fact that I
    > hadn't been seeing the old "WiFi spinup when waking up the device with
    > the power button" as much as before.
     
    You would have noticed sooner had you been using my stupid little WiFi
    widget :)
     
    > find anything in the Settings app to control this timeout, and I don't
    > recall seeing anything in the SDK about it (though it's not like I
    > have been looking).
     
    The default appears to vary by OS version (and possibly the
    manufacturer's whims).
     
    According to my sources
     
    (
    4.0.1/packages/apps/Settings/src/com/android/settings/wifi/AdvancedWifiSettings.java
    )
     
    the policy is stored under:
     
    http://developer.android.com/reference/android/provider/Settings.System.html#WIFI_SLEEP_POLICY
     
    From an application's point of view, though, it's just same old
    ConnectivityManager.getActiveNetworkInfo - the connection is either
    there and it's WiFi, or it's not.
     
    -- K

     

    Mark Murphy <mmurphy@commonsware.com> Mar 30 08:31AM -0400  

    > You would have noticed sooner had you been using my stupid little WiFi
    > widget :)
     
    Yeah, well, it might not have been on my primary home screen page.
     
    :-)
     
     
    > (
    > 4.0.1/packages/apps/Settings/src/com/android/settings/wifi/AdvancedWifiSettings.java
    > )
     
    IMHO, the SwitchPreference where tapping on the preference *also*
    launches a nested PreferenceScreen is lousy UX. I keep forgetting
    there are options under the WiFi one, until I'm trying to connect to
    some new AP and then eventually stumble upon it. And, of course,
    buried inside of there are the advanced settings.
     
    FWIW, the Galaxy Nexus default seems to be always-on -- I toggled mine
    back to only-when-plugged-in.
     
    > the policy is stored under:
     
    > http://developer.android.com/reference/android/provider/Settings.System.html#WIFI_SLEEP_POLICY
     
    Ah, OK, that's what I was looking for.
     
    > From an application's point of view, though, it's just same old
    > ConnectivityManager.getActiveNetworkInfo - the connection is either there
    > and it's WiFi, or it's not.
     
    Well, the decision on whether to use a WifiLock would be based in part
    on WIFI_SLEEP_POLICY -- if WIFI_SLEEP_POLICY is
    WIFI_SLEEP_POLICY_NEVER, you do not need the WifiLock. That was the
    point behind your original post on this thread IIRC.
     
    Many thanks!
     
    --
    Mark Murphy (a Commons Guy)
    http://commonsware.com | http://github.com/commonsguy
    http://commonsware.com/blog | http://twitter.com/commonsguy
     
    _The Busy Coder's Guide to *Advanced* Android Development_ Version 2.5
    Available!

     

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 15 Topics

Comments: (0)

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

    Kirupa <answerofandroid@gmail.com> Mar 30 02:37AM -0700  

    [2012-03-30 15:05:16 - Information Exchanger 2.7.3] Installation
    error: INSTALL_FAILED_INSUFFICIENT_STORAGE
    [2012-03-30 15:05:16 - Information Exchanger 2.7.3] Please check
    logcat output for more details.
    [2012-03-30 15:05:16 - Information Exchanger 2.7.3] Launch canceled!
    How can i solve the problem?

     

    Anirudh Loya <loya.anirudh@gmail.com> Mar 30 04:01PM +0530  

    Chance the Cache Memory size of Android Virtual Device.
     
     
    --
     
    Thank you****
     
    Anirudh Loya | Android Developer**
     
    Desk: +9140-30681824 | Mobile: +91*9246561265*
     
    *Love your Job but don't Love your company, Because you may not know when
    your company stops loving you.-- Voice Of Love*

     

    "s.rawat" <imsaurabhrawat@gmail.com> Mar 30 04:05PM +0530  

    Hi,
    You can try installing it on external sd card.
    Add this attribute in the manifest file :
     
    android:installLocation="preferExternal"
     
    It will work like charm.
     
    Rgds,
    Saurabh
    "..pain is temporary.....quitting lasts forever......"
     
     
     

     

    Anirudh Loya <loya.anirudh@gmail.com> Mar 30 04:04PM +0530  

    Use XML with sitelist.. !! It will work fine.
     
    No idea about document builder.
     
     
    --
     
    Thank you****
     
    Anirudh Loya | Android Developer**
     
    Desk: +9140-30681824 | Mobile: +91*9246561265*
     
    *Love your Job but don't Love your company, Because you may not know when
    your company stops loving you.-- Voice Of Love*

     

    saex <elpablosaez@gmail.com> Mar 30 03:33AM -0700  

    Hi
     
    I received an Archos 80 G9 and i need to use it to develop with eclipse. I
    follow these instructions:
     
    http://www.archos.com/support/support_tech/updates_adb.html?country=ws&lang=en
     
    I added *0x0e79 *to the ini file* *and also i have installed the goolge usb
    drivers, because before this i was developing with google nexus one and
    google official usb driver, so it is installed.
     
    But eclipse didn't detect Archos when it is pluged in. Windows 7 is
    detecting it as a Massive Storage device....
     
    ¿how can i solve this?
     
    thanks

     

    Mega Bytes <bytes1024mega@gmail.com> Mar 30 04:00PM +0530  

    Hi All Friends,
     
    I am new in android and I had developed a TextEditor Application in Android.
    Bt I have problem with storing data,
    how can I store it in SD card or in phone memory, how can I locate this.
    Please help me about this.. I have submission my project in college untill
    10th april.
    So please provide me code or related information.
     
    Thanks And Regards
    Mega Bytes

     

    "Febi.M.Felix Maliakkal" <febimfelix@gmail.com> Mar 30 03:33PM +0530  

    Information is really helpful..
     
    --
    *
    *
    With Thanks & Regards
     
    FEBI.M.FELIX*
    *

     

    Anirudh Loya <loya.anirudh@gmail.com> Mar 30 04:01PM +0530  

    Which information ?
     
    On Fri, Mar 30, 2012 at 3:33 PM, Febi.M.Felix Maliakkal <
     
    --
     
    Thank you****
     
    Anirudh Loya | Android Developer**
     
    Desk: +9140-30681824 | Mobile: +91*9246561265*
     
    *Love your Job but don't Love your company, Because you may not know when
    your company stops loving you.-- Voice Of Love*

     

    Kostya Vasilyev <kmansoft@gmail.com> Mar 30 02:29PM +0400  

    This depends on the WiFi sleep policy in effect in the device's settings.
     
    Recent Android versions (starting with 2.3, AFAICT) appear to have the
    default to keep WiFi on at all times, including when the phone goes to
    sleep.
     
    If that's the case for a particular device, you can just not worry about
    this.
     
    Otherwise, yes, you will need to acquire a WifiLock and wait for the system
    to 1) power on the hardware 2) scan, connect, get IP 3) switch the routing
    from mobile to WiFi data.
     
    This setup takes about 10-20 seconds (again, based on my observations), so
    if your app only needs a small amount of data, it might have higher battery
    use from trying to do it over WiFi.
     
    -- K
     

     

    Kostya Vasilyev <kmansoft@gmail.com> Mar 30 02:30PM +0400  


    > If the wifi radio is disabled when the phone goes to sleep, then how does
    > the e-mail app sync?
    > Does it mean that the e-mail app holds a wifi lock?
     
    There is an easy way to find out - use the source, Luke :)
     
     

     

    saex <elpablosaez@gmail.com> Mar 30 03:16AM -0700  

    I have an application that can be viewed with landscape and portrait mode. I'm
    not using onConfigurationChanged() and
    android:configChanges="orientation|keyboardHidden" and the screen
    orientation change is working perfectly.
     
    But now, i have a small problem. I want to learn to lock the screen
    orientation change of the screen. I mean that for example, when the user
    press a "lock" button, the screen orientation must be locked and it must
    not change, and when the user press again that button, the screen
    orientation must get unlocked
     
    ¿how can i lock the screen orientation dinamically?

     

    EhyehAsherEhyeh <jacobsen.arild@gmail.com> Mar 30 01:02AM -0700  

    Try AsyncTask? You can have doInBackground downloading the images,
    then call publishProgress for each image completed, and have
    onProgressUpdate update the gridview. You should have no problem
    finding tutorials on how to use AsyncTask with a quick search.
     
    On Mar 29, 11:31 am, "Febi.M.Felix Maliakkal" <febimfe...@gmail.com>
    wrote:

     

    "Febi.M.Felix Maliakkal" <febimfelix@gmail.com> Mar 30 03:04AM -0700  

    Thank You...:)
     
    On Friday, March 30, 2012 1:32:24 PM UTC+5:30, EhyehAsherEhyeh wrote:

     

    Remote Red <rremmels@gmail.com> Mar 30 01:12AM -0700  

    > But the question marks in the in the file i attached are because google
    > groups did not get it right the document... Locally it works and I can send
    > it through mail without issues.
     
    Sorry but I find it hard to believe that when Google offers us a
    platform to discuss development and offers the possibility to upload
    files so we can show them others that those files are changed and
    corrupted.
     
    A giant as Google would never do that....

     

    Remote Red <rremmels@gmail.com> Mar 30 01:34AM -0700  

    > excel the first characters are  not show, the file always starts with *
    > artdate"* .
     
    > Any idea how to work around this?
     
    You are using put(). Those three statements will overwrite the
    first three bytes.
     
    Isn't there an insert() ?
     
    If not: just first write the bom and then the bytes.

     

    Dirk Vranckaert <dirkvranckaert@gmail.com> Mar 30 02:44AM -0700  

    Sadly there is no insert and indeed the put overwrites the bytes.
     
    The charset.encode(...) gives me a ByteBuffer that I cannot retrieve
    'empty'...
     
    Adding (put) the BOM first should be ok, but then adding all the test-bytes
    will not work. Then again I have to loop over all the bytes...
     
    Op vrijdag 30 maart 2012 10:34:20 UTC+2 schreef Remote Red het volgende:

     

    Remote Red <rremmels@gmail.com> Mar 30 02:55AM -0700  

    Looping?
     
    byte[] bom = {(byte)0xEF, (byte)0xBB, (byte)0xBF };
    byte[] byteResult =
    Charset.forName("UTF-8").encode(result.toString()).array();
     
    fos = new FileOutputStream(file);
    fos.write(bom);
    fos.write(byteResult);
     
    Doesn't this work?

     

    jagruti sangani <jugni1smile@gmail.com> Mar 30 02:54PM +0530  

    you can use calender also for the getting the current date and time.also
    you can get separate form that.But in which format you want?
     
     
    --
    Regards
    jagruti Sangani
    *iNextrix Technologies*

     

    jagruti sangani <jugni1smile@gmail.com> Mar 30 02:52PM +0530  

    For receiving call you need to apply Broacastreceiver for that.and then
    when the application run in background then open new activity from the
    broadcastreceiver so it will automatic open the application in front.
     
     
    --
    Regards
    jagruti Sangani
    *iNextrix Technologies*

     

    DraganA <dandric@gmail.com> Mar 30 01:27AM -0700  

    Me too. Sales have slowed down in the last couple of weeks. I notice
    much fewer purchases from the US.. I'm from the UK.
     

     

    Kirupa <answerofandroid@gmail.com> Mar 30 01:15AM -0700  

    I want to access database of an application(I know the structure of
    database) from the another android phone.(every android phone has same
    application same database).

     

    EhyehAsherEhyeh <jacobsen.arild@gmail.com> Mar 30 01:00AM -0700  

    Bitmap doesn't implement Serializable. You could override readObject
    and writeObject for your simple class and in those methods read and
    write the Bitmap to a byte array for instance.
     

     

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 14 Topics

Comments: (0)

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

    Terry <terboel@gmail.com> Mar 30 12:27AM -0700  

    How to keep developing an app - to take advantage of new features in
    new Android versions - and still support old customers?
     
    What is the best approach?
     
    Example: Let us say that I want to use the front facing camera, which
    seems to be supported from Android version 2.3, and I originally made
    the app to support Android version 1.6 and newer? If a make a new
    version of my app - setting minSkdVersion to the value corresponding
    to Android 2.3, then my old customers cannot use it. Is that OK? Am I
    not letting my old customers down then?
     
    On the other side, if I always want to support Android version 1.6,
    then I cannot take advantage of all the new features of Android. Or
    can I? Is there another way?
     
    What is the best strategy?
     
    Regards, Terry

     

    Neil <neil.ghosh@gmail.com> Mar 30 12:10AM -0700  

    Hi All,
    I want to create an Android app as background service. Specifically . I
    want the app to respond when there an incoming call and do some function
    getting the caller information. Any pointer will be appreciated !

     

    Narendra Singh Rathore <nsr.curious@gmail.com> Mar 30 12:53PM +0530  

    > I want to create an Android app as background service. Specifically . I
    > want the app to respond when there an incoming call and do some function
    > getting the caller information. Any pointer will be appreciated !
     
     
    I guess, you need to implement Broadcast Rceiver for that.
    Your application must contain a Receiver that will receive the Broadcast,
    whenever the call is received.
     
    I hope you got it and able to enhance it further.
     
    With Regards,
    Narendra...

     

    Raju Gaddam <gaddam967267@gmail.com> Mar 30 12:50PM +0530  

    Hi android developers,
     
    Please tell me how to lanuch pdf &ppt and word document form server to
    android application .here which library's are required to develop this
    plese provide any links or tutorials.
     
     
    Thanks
    raju

     

    Eyal Berman <bermaneyal@gmail.com> Mar 30 12:05AM -0700  

    i try to format a date from XML file the date is in the format "Thu, 15
    Mar 2012 00:00:00 +0200"
     
    i use that code but get an error
     
    SimpleDateFormat formatter = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss
    Z");
    Date date = formatter.parse("Thu, 15 Mar 2012 00:00:00 +0200");
    SimpleDateFormat simpleDateFormat =new SimpleDateFormat("dd/MM/yyyy");
    String dateAsString = simpleDateFormat.format(date);
     
    java.text.ParseException: Unparseable date: "Thu, 15 Mar 2012 00:00:00
    +0200"

     

    Kostya Vasilyev <kmansoft@gmail.com> Mar 30 02:07AM +0400  

    > "
     
    > It also says that the need for it is something Notepad decided despite
    > that it violates the recommendation.
     
    IIRC, Notepad++ has a menu to switch encoding on an already loaded file.
    Perhaps it was as simple as clicking there.
     
    -- K
     
     

     

    b0b <pujos.michael@gmail.com> Mar 29 03:15PM -0700  

    For your code to work you need:
     
    out.write(result.toString("UTF-8));

     

    Lew <lewbloch@gmail.com> Mar 29 03:38PM -0700  

    b0b wrote:
     
    > For your code to work you need:
     
    > out.write(result.toString("UTF-8));
     
    How do you know that the type of 'result' supports such a method? The OP
    did not indicate the type of 'result'.
     
    Surely you are aware that 'String' values in Java are always UTF-16?
    <http://docs.oracle.com/javase/7/docs/api/java/lang/String.html>
     
    --
    Lew

     

    Dirk Vranckaert <dirkvranckaert@gmail.com> Mar 30 12:04AM -0700  

    I did specify the type of result ;) It's a StringBuilder and does indeed
    not support the toString("UTF-8")
     
    What I did now:
    FileOutputStream fos = null;
    byte[] byteResult = Charset.forName("UTF-8").encode(result.toString())
    .put(0, (byte) 0xEF)
    .put(1, (byte) 0xBB)
    .put(2, (byte) 0xBF)
    .array();
    fos = new FileOutputStream(file);
    fos.write(byteResult);
     
    This works! It's showing my hebrew and chinese characters correct!
     
    But I still have one issue:
    The string result.toString() starts with this data (double quotes
    included): *"Startdate";"Starttime";"Enddate";*
    However when the file is created and I open it with either notepad++ or
    excel the first characters are not show, the file always starts with *
    artdate"* .
     
    Any idea how to work around this? I though that maybe it just took the
    first few characters (always 3) after the BOM into account but I added some
    spaces between the BOM (exactly 3) and then it's ok. It's a work-around but
    not really the best I hope...
     
    Kr,
     
    Dirk
     
    Op vrijdag 30 maart 2012 00:38:08 UTC+2 schreef Lew het volgende:

     

    "s.rawat" <imsaurabhrawat@gmail.com> Mar 30 11:33AM +0530  

    Hi,
    How can I achieve this,I have googled a lot but couldn't find much
    useful.may be I dont know the exact keyword for searching.Can someone help
    me on this.Attched is the table 1 and table 2.I want the cells as drawn in
    the table 2(solid-shaded-3d), right now i have coded for table 1.
    Rgds,
    Saurabh
     
     
    "..pain is temporary.....quitting lasts forever......"

     

    Put_tiMe <puttime@gmail.com> Mar 29 10:50PM -0700  

    How can I goto sleep mode on a device?

    Is it only via the UI interface by long pressing the "Screen On" button?

    Or does it reach automatically goto sleep mode after "X" minutes after the
    screen has been switched off?

     

    Put_tiMe <puttime@gmail.com> Mar 29 10:34PM -0700  

    Is there any way I can get a list of apps that have acquired the wifi lock?

     

    Put_tiMe <puttime@gmail.com> Mar 29 09:31PM -0700  

    I want to know if I can do this:

    I have two alarm managers, to trigger once every X minutes.

    Alarm A: every 10 minutes
    Alarm B: every 12 minutes.

    I start both of them at once. So "A" should hit every 10 mins, and "B"
    should hit every 12 mins.

    Now in "A", I create a wifi lock, and acquire it.
    Because intents raised by alarm-manager won't have a concept of instance, I
    can't save this wifi-lock object anywhere.

    In "B", How can I use the same wifi lock object to release the wifi lock?

    Is it possible?

     

    Put_tiMe <puttime@gmail.com> Mar 29 10:29PM -0700  

    Another question, if a particular app has acquired the wifi-lock.
    Another app goes and switches off the wifi.

    What happens now?
    Will the wifi-lock prevent the wifi from switching it off?
    Or is the wifi lock ignored, and the wifi radio is still switched off.



     
    On Friday, March 30, 2012 10:01:32 AM UTC+5:30, Put_tiMe wrote:
     

     

    Put_tiMe <puttime@gmail.com> Mar 29 08:08PM -0700  

    What about this situation::

    1. I set an AlarmManager to wake up every 15 minutes.
    2. I switch off the screen, and the phone goes to sleep in a few minutes.
    3. After 15 mins, the alarm manager kicks in.
    4. In the alarm manager handler code, can I take a wifi lock? Will this
    work?
    5. Then after my job is done (in about 40 seconds) I'll release the wifi
    lock.

    Does the above stategy look okay?

     
    On Thursday, March 29, 2012 6:59:56 PM UTC+5:30, Mark Murphy (a Commons
    Guy) wrote:
     

     

    Put_tiMe <puttime@gmail.com> Mar 29 10:06PM -0700  

    If the wifi radio is disabled when the phone goes to sleep, then how does
    the e-mail app sync?
    Does it mean that the e-mail app holds a wifi lock?


     
    On Friday, March 30, 2012 8:38:23 AM UTC+5:30, Put_tiMe wrote:
     

     

    Kristopher Micinski <krismicinski@gmail.com> Mar 29 11:40PM -0400  

    I don't use eclipse either, I generally use emacs and the ant build
    tools packaged with the SDK, they generally work quite well (although
    I've never had to do super advanced compilation, I run a somewhat
    comprehensive setup most of the time, with a few hundred files, AIDL,
    multiple Services, apps, etc..).
     
    Although,
     
    http://code.google.com/p/maven-android-plugin/
     
    kris
     

     

    mike digioia <mpd395@gmail.com> Mar 29 09:42PM -0700  

    Yes thanks. I just discovered all the documentation available for maven,
    mailing lists and use of android project with maven. I noticed your link
    thanks.
     
    I was expecting to automatically port my maven project over to eclipse but
    the maven tool never completed without missing at least 4 required
    repositories. So now I have to come up to speed on maven to move from
    eclipse. Great!
    On Mar 29, 2012 8:40 PM, "Kristopher Micinski" <krismicinski@gmail.com>
    wrote:
     

     

    Jinja <neiljmartin@gmail.com> Mar 29 07:13PM -0700  

    I don't know much about this, but a quick look at the docs and I'm guessing
    this is your problem...
     
    FLAG_ACTIVITY_NEW_TASK = If set, this activity will become the start of
    a new task on this history stack.
     
    You've created a new activity which you are indeed closing, to reveal your
    old activity that's still on the stack. I don't know what the correct one
    to use instead, but this looks promising...
     
    FLAG_ACTIVITY_SINGLE_TOP<http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_SINGLE_TOP>
    = If set, the activity will not be launched if it is already running at
    the top of the history stack.
     
     
    Check the above flags here...
     
    http://developer.android.com/reference/android/content/Intent.html
     
    Good luck
     
    On Tuesday, March 27, 2012 12:35:21 AM UTC-7, vani wrote:

     

    Justin Anderson <magouyaware@gmail.com> Mar 29 03:59PM -0600  

    Good catch Kostya... I didn't notice the two different layouts until you
    mentioned it.
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     
    2012/3/29 Kostya Vasilyev <kmansoft@gmail.com>
     

     

    Walaa Mahmoud <walaamahmoud65@gmail.com> Mar 30 03:52AM +0200  

    Firstly i used it this way after trying viewholder and didn't work so i
    wanted every layout for both send and receive to be separated so when flag
    true and i'm receiving it should update only current item with the name and
    FB profile picture of sender and keep previous rows without updating ,here
    is all the code
     
     
    public class MarkChat extends Activity {
     
    // private ArrayList<Chat> chatList = new ArrayList<Chat>();
    private ArrayList<String> messages = new ArrayList<String>();
    static ArrayList<String> Name = new ArrayList<String>();
     
    EditText mSendText;
    Context context;
    ConversationListAdapter adapter;
    private static Handler mHandler = new Handler();
    ListView list;
    String friendJid;
    Message message;
    static String Messname;
    static String messagfrom;
    String friendName;
    Bitmap img;
    String MYNamen = "Me";
    int num=0;
     
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.bubbles);
    list = (ListView) findViewById(R.id.chatlist);
     
    // /getting buddy info
    Bundle b = getIntent().getExtras();
    friendJid = b.getString("username");
    friendName = b.getString("BuddyNAME");
    Log.d("friendName", "" + friendName);
    if (getIntent().hasExtra("byteArray")) {
    img = BitmapFactory.decodeByteArray(
    getIntent().getByteArrayExtra("byteArray"), 0, getIntent()
    .getByteArrayExtra("byteArray").length);
    }
     
    // some where in code
    Name.add(friendName);
    Name.add(MYNamen);
    adapter = new ConversationListAdapter(getApplicationContext(),
    num, messages);
     
    mSendText = (EditText) findViewById(R.id.chat_input_text);
     
    // when I send/receive msg. -----------------START-------------
    if (Main.conn != null) {
     
    // Add a packet listener to get messages sent to us
    PacketFilter filter = new MessageTypeFilter(Message.Type.chat);
    Main.conn.addPacketListener(new PacketListener() {
     
    public void processPacket(Packet p) {
     
    if (message.getBody() != null) {
    adapter.flag = true;
    messages.add(message.getBody());
    Log.d("AsmackRecieve", "" + adapter.flag);
     
    // Add the incoming message to the list view
    mHandler.post(new Runnable() {
    public void run() {
     
    list.setAdapter(adapter);
    //adapter.notifyDataSetChanged();
    }
    });
    }
     
    }
    }, filter);
     
    adapter.flag = false;
    }
     
    // Set a listener to send a chat text message
    Button send = (Button) this.findViewById(R.id.chat_send_button);
    send.setOnClickListener(new View.OnClickListener() {
    public void onClick(View view) {
     
    String text = mSendText.getText().toString();
     
    adapter.flag = false;
    Log.i("XMPPClient", "Sending text [" + text + "] ");
    message = new Message(friendJid, Message.Type.chat);
    message.setBody(text);
    Main.conn.sendPacket(message);
    messages.add(text);
     
    list.setAdapter(adapter);
    //adapter.notifyDataSetChanged();
    }
    });
     
    // when I send/receive msg. ---------------END---------------
     
    }
    }
     
    class ConversationListAdapter extends ArrayAdapter<String> {
     
    Context con;
    LayoutInflater mInflater;
    ArrayList<String> groups;
    ArrayList<String> groupsMessage;
    boolean flag = false;
    TextView title, titleOdd, body, bodyOdd;
     
    public ConversationListAdapter(Context context, int textViewResourceId,
    ArrayList<String> objects) {
    super(context, textViewResourceId, objects);
    this.con = context;
    mInflater = LayoutInflater.from(context);
    this.groupsMessage=objects;
    }
     
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
     
    ViewHolder h;
    View v = null;
     
    if (flag) {
     
    if (convertView == null) {
    // //for incoming
    h = new ViewHolder();
    v = mInflater.inflate(R.layout.evenbubble, null);
     
    title = (TextView) v.findViewById(R.id.BuddyTitle);
    body = (TextView) v.findViewById(R.id.BuddyMessage);
    v.setTag(h);
    } else {
    v = convertView;
    }
    Log.d("FLAG", "" + flag);
    body.setText(groupsMessage.get(position));
     
    title.setText(MarkChat.Name.get(0));
     
    } else {
     
    // /for outcoming
    if (convertView == null) {
    h = new ViewHolder();
    v = mInflater.inflate(R.layout.oddbubble, null);
     
    titleOdd = (TextView) v.findViewById(R.id.BuddyTitle);
    bodyOdd = (TextView) v.findViewById(R.id.BuddyMessage);
    v.setTag(h);
    } else {
     
    v = convertView;
    }
    Log.d("FLAG", "" + flag);
    bodyOdd.setText(groupsMessage.get(position));
     
    titleOdd.setText(MarkChat.Name.get(1));
    }
    return v;
    }
     
    }
     
     
    2012/3/29 Justin Anderson <magouyaware@gmail.com>
     

     

    Jim Graham <spooky130u@gmail.com> Mar 29 05:05PM -0500  

    On Fri, Mar 30, 2012 at 01:38:15AM +0400, Kostya Vasilyev wrote:
    > 29 ????? 2012 ?. 23:07 ???????????? Jim Graham <spooky130u@gmail.com>???????:
     
    > In fact, I need to apologize for calling "obj.toString()" a typecast in my
    > original message. It's not, of course, rather it's a method call.
     
    I think I missed that part.
     
     
    > Sure seems that you do, but then -- you're an adult and I'm not your
    > mother, so I'm not going to reproach you for having had to ask in the first
    > place :)
     
    No matter what, I still have lots of reading to do, and I'm not the least
    bit afraid to admit that.
     
    > Almost anyone gets stuck and needs a bit of help with something sooner or
    > later.
     
    And it seems that on this particular app, I'm getting stuck far more
    often than in previous ones. :-( Fortunately, in each case, I've
    either lucked out and basically stumbled across the answer (or just
    got lucky?), or gotten help via either this list or direct e-mail to
    a friend here. Of course, I've only re-done my layout (let's see...how
    many times?) about 3 times now. My others looked nice on paper, and in
    a visio drawin, but when actually implemented...well.....
     
    > That's cool, it's what this list is for.
     
    True.
     
    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
     
    "Now what *you* need is a proper pint of porter poured in a proper
    pewter porter pot.." --Peter Dalgaard in alt.sysadmin.recovery
     
    Android Apps Listing at http://www.jstrack.org/barcodes.html

     

    Ray Tayek <rtayek@ca.rr.com> Mar 29 03:42PM -0700  

    At 04:21 AM 3/29/2012, you wrote:
    >without a force close) get that List<x> to x[] (where 'x' is String,
    >Integer, etc.), I could then feed that to the ArrayAdapter and "feed"
    >the Spinner. ...
     
    list.toArray(new String[0])
     
    thanks
     
     
    ---
    co-chair http://ocjug.org/

     

    Lew <lewbloch@gmail.com> Mar 29 04:22PM -0700  

    Ray Tayek wrote:
     
    > >Integer, etc.), I could then feed that to the ArrayAdapter and "feed"
    > >the Spinner. ...
     
    > list.toArray(new String[0])
     
    From the API docs for 'toArray(T[] a)':
    ArrayStoreException<http://docs.oracle.com/javase/7/docs/api/java/lang/ArrayStoreException.html> -
    if the runtime type of the specified array is not a supertype of the
    runtime type of every element in this list
     
    The OP's original list variable was 'bar' but they never told us the type
    of that variable. What they said was:
     
    > String[] foo = (String[]) bar.toArray();
     
    > And this caused a force close, where the error stated that you can't
    > cast toArray() to String[].
    If 'bar' is of type 'String[]' then, of course, your tip will work
    perfectly.
     
    --
    Lew

     

    Jim Graham <spooky130u@gmail.com> Mar 29 06:31PM -0500  

    On Thu, Mar 29, 2012 at 03:42:29PM -0700, Ray Tayek wrote:
    > >Integer, etc.), I could then feed that to the ArrayAdapter and "feed"
    > >the Spinner. ...
     
    > list.toArray(new String[0])
     
    Thanks!
     
    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
     
    "'Wrong' is one of those concepts that depends on witnesses."
    --Catbert: Evil Director of Human Resources (Dilbert, 05Nov09)
     
    Android Apps Listing at http://www.jstrack.org/barcodes.html

     

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

    AndroidGirl8 <walaamahmoud65@gmail.com> Mar 29 10:51AM -0700  

    Hi,
    I had a problem with designing chat custom listview but when i update list
    when user send or receive message it update all previous rows with the name
    of new sender/receiver and seems like one person send/receive all messages!!
     
    i tried everything and then think how to stop list from updating previous
    items and only work with specific current item only , here is what i'm
    using now in baseAdapter.
     
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
     
    ViewHolder h;
    View v = null;
     
    if (flag) {
     
    if (convertView == null) {
    // //for incoming
    h = new ViewHolder();
    v = mInflater.inflate(R.layout.evenbubble, null);
     
    title = (TextView) v.findViewById(R.id.BuddyTitle);
    body = (TextView) v.findViewById(R.id.BuddyMessage);
    v.setTag(h);
    } else {
    v = convertView;
    }
    Log.d("FLAG", "" + flag);
    body.setText(groupsMessage.get(position));
     
    title.setText(MarkChat.Name.get(0));
     
    } else {
     
    // /for outcoming
    if (convertView == null) {
    h = new ViewHolder();
    v = mInflater.inflate(R.layout.oddbubble, null);
     
    titleOdd = (TextView) v.findViewById(R.id.BuddyTitle);
    bodyOdd = (TextView) v.findViewById(R.id.BuddyMessage);
    v.setTag(h);
    } else {
     
    v = convertView;
    }
    Log.d("FLAG", "" + flag);
    bodyOdd.setText(groupsMessage.get(position));
     
    titleOdd.setText(MarkChat.Name.get(1));
    }
    return v;
    }

     

    Justin Anderson <magouyaware@gmail.com> Mar 29 12:12PM -0600  


    > I had a problem with designing chat custom listview but when i update list
    > when user send or receive message it update all previous rows with the name
    > of new sender/receiver and seems like one person send/receive all messages!!
     
    That code doesn't make a lot of sense... We don't know what MarkChat is,
    for one. We don't really know how the flag works as well.
     
    But I can tell you that you have a problem with your ViewHolder pattern.
    Your title and body variables should be members of the ViewHolder class,
    not member variables of your adapter class. I don't know why you would
    really need titleOdd and bodyOdd either...
     
    Also, you have to remember that when a listview updates itself, it will
    update every view that it is currently displaying on the screen, at the
    very least. There is nothing you can do to change that. That means that
    getView() will be called one time for each item currently on the screen....
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     

     

    Nadeem Hasan <nhasan@nadmm.com> Mar 29 11:43AM -0700  

    The MarkChat.Name.get() returns the same value for all your list items.
    That is causing the name to be the same for all items. It should return the
    name based on the "position" of the item in the adapter.
     
    Also, as Justin noted, your ViewHolder usage seems to be incorrect. Try
    something like below:
     
    *if* (convertView == null) {
    h = new ViewHolder();
    v = mInflater.inflate(R.layout.oddbubble, null);
    h.title = (TextView) v.findViewById(R.id.BuddyTitle);
    h.body = (TextView) v.findViewById(R.id.BuddyMessage);
    v.setTag(h);
    } *else* {
    h = convertView.getTag();
    }
    h.body.setText(groupsMessage.get(position));
    h.title.setText(MarkChat.Name.get(position));

     

    Justin Anderson <magouyaware@gmail.com> Mar 29 01:12PM -0600  


    > The MarkChat.Name.get() returns the same value for all your list items.
     
    That's what I thought at first as well... But I think this list view
    represents a chat between two people... And so, depending on the item in
    the list, the OP only wants to return one of two names... I may be wrong,
    but that is what I inferred from these two lines:
     
    title.setText(MarkChat.Name.get(0));
    > titleOdd.setText(MarkChat.Name.get(1));
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     
    On Thu, Mar 29, 2012 at 12:43 PM, Nadeem Hasan <nhasan@nadmm.com> wrote:
     

     

    Nadeem Hasan <nhasan@nadmm.com> Mar 29 01:14PM -0700  

    Justin,
     
    You are right. In that case, I think the culprit is the "flag". It is
    supposed to be true for incoming and false for outgoing. But, it remains
    static while listview is building its items. I think this flag should be in
    the adapter along with message.

     

    Justin Anderson <magouyaware@gmail.com> Mar 29 02:49PM -0600  

    That its what I was thinking as well...

     

    Kostya Vasilyev <kmansoft@gmail.com> Mar 30 01:45AM +0400  

    Note that there are two layouts being used here:
     
    R.layout.evenbubble
    R.layout.oddbubble
     
    Without overriding getViewTypeCount / getItemViewType in the adapter and
    returning the right item type...
     
    .. the list view will mix up those two layouts when recycling, which would
    appear as a list of "send" bubbles or a list of "receive" bubbles.
     
    The view type presumably should be based on "flag", which in turn, as was
    already noted, presumably should depend on the item's position, and a data
    structure lookup to determine if it's a "send" bubble or a "receive" bubble.
     
    -- K
     
    30 марта 2012 г. 0:49 пользователь Justin Anderson

     

    Lew <lewbloch@gmail.com> Mar 29 11:35AM -0700  

    Spooky wrote:
    > > The issue is that you're trying to cast *the array* whereas you
    > > intent was probably to cast *each element of the array*.
     
    > I was just trying to directly convert the List (in this case,
     
    "I was just trying ..." implies that the rules of Java should accommodate
    your programming instead of the other way around.
     
    Java doesn't let you cast across type hierarchies. Thus, you cannot cast
    'Camera.Size' to 'String', nor can you cast 'Camera.Size[]' to 'String[]'.
     
    You might find the Java tutorials informative.

     
     
    > > Or you could combine the arrays into one Object[] array. The adapter
    > > would then call toString on each Object inside the array.
     
    > Again, multiple arrays, not one.
     
    Again, he's just making suggestions. Again.

     
     
    > I've already got that covered. :-) A simple switch() in onItemClicked
    > will determine which type of settings are in effect, and respond
    > accordingly.
     
    Switching on types is an antipattern in O-O programming. Polymorphism, will
    do that switch for you.

     
     
    > I'm afraid that's far above my level at this point (let's put it this
    > way, I was debating on whether to post this in this list or the
    > android-for-beginners list). I'm still not sure whether that list
     
    The right answer remains the right answer regardless of your level. Maybe
    you should rise to the level that you can use this suggestion.

     
    > beginner-level question here, or was it more at an intermediate level?).
     
    > Either way, I can use the example you showed above, and I think that'll
    > work for me.
     
    The wrapper approach is one way but I normally use the simple array-copy
    technique. Why are you so afraid of that loop?
     
    List<String> choices = new ArrayList<String>(sizes.size());
    for (Camera.Size size : sizes )
    {
    choices.add(size.toString());
    }
     
    --
    Lew

     

    Jim Graham <spooky130u@gmail.com> Mar 29 02:07PM -0500  

    On Thu, Mar 29, 2012 at 11:35:32AM -0700, Lew wrote:
     
    > > I was just trying to directly convert the List (in this case,
     
    > "I was just trying ..." implies that the rules of Java should accommodate
    > your programming instead of the other way around.
     
    No, it doesn't. It implies (rather strongly) that I thought, based on
    the portions of the Dev Guide that I'd read on this, that I knew what I
    was doing. I was wrong. Get over it...I have.
     
    > Java doesn't let you cast across type hierarchies. Thus, you cannot cast
    > 'Camera.Size' to 'String', nor can you cast 'Camera.Size[]' to 'String[]'.
     
    Nor did I try (nor WOULD I try to do something stupid like that). Go
    back and READ my original post. I said that I hadn't even GOTTEN to any
    Camera.Size stuff---so far, only one, and that WAS a String[]. Where,
    from THAT, do you get that I'm assuming I can just cast (and thus
    magically translate) Camera.Size to String[]? Answer: you don't.
     
    > You might find the Java tutorials informative.
     
    Again, read what I posted. How many Java books did I go through? I lost
    count.
     
    > > List<String>) to an array of strings (String[]). I hadn't gotten
    > > as far as the other settings types yet---just preparing for them
    > > when I get to them.
     
    There...see, I said it again. I hadn't gotten being List<String> and
    String[]. Read what you're replying to next time. :-)
     
     
    > > ... etc....I was hoping for a direct conversio for each List to each
    > > respective array, but I'm starting to think that might not be ideal,
    > > after all.
     
    And just in case that was misunderstood, I was saying that I liked his
    idea, and that I thought it would work for me.
     
    > > > would then call toString on each Object inside the array.
     
    > > Again, multiple arrays, not one.
     
    > Again, he's just making suggestions. Again.
     
    Yes...I know. But the above assumes (or at least, appears to assume)
    that I'm handing one huge list of settings to the spinner, whereas I'm
    planning to reuse one spinner with multiple sets of data. I haven't
    tried that yet, and if it doesn't work, that'll be just another lesson
    learned for me. So I was just clarifying what I had in mind.
     
    > > accordingly.
     
    > Switching on types is an antipattern in O-O programming. Polymorphism, will
    > do that switch for you.
     
    Did I say ANYTHING about switching based on variable types? No. I was
    saying that I would use the switch to take actions based on what the DATA
    was. In other words, if spinner item #2 is "Incandescent" then I know
    that the spinner's current data set is White Balance settings.
    Understand now? :-)
     
    > > work for me.
     
    > The wrapper approach is one way but I normally use the simple array-copy
    > technique. Why are you so afraid of that loop?
     
    You mean the loop that, in the quoted text that you just responded to, I
    I said I liked the loop idea, and implied that I would probably just use
    it? Hmmmm? Read *what I wrote*. If you're trying to read my MIND,
    instead, you're doing an absolutely miserable job of it. Even my CATS
    do better than that (actually, they do really well at it). :-)
     
    > {
    > choices.add(size.toString());
    > }
     
    Looks like the example I already decided to use. :-)
     
    Kostya answered my question with a perfectly useable solution, and I
    thought, in my response, that I made my appreciation for that clear.
    Apparently, I didn't make that as clear as I thought I did. Apologies,
    Kostya, for not making my appreciation for your help clear.
     
    I still have some reading to do, but Kostya put me on the right track,
    which is exactly what I needed, and what I was looking for.
     
    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

     

    Lew <lewbloch@gmail.com> Mar 29 01:12PM -0700  

    Spooky wrote:
     
     
    > No, it doesn't. It implies (rather strongly) that I thought, based on
    > the portions of the Dev Guide that I'd read on this, that I knew what I
    > was doing. I was wrong. Get over it...I have.
     
    You might want to cool your attitude down a notch, there, buddy.

     
    > Camera.Size stuff---so far, only one, and that WAS a String[]. Where,
    > from THAT, do you get that I'm assuming I can just cast (and thus
    > magically translate) Camera.Size to String[]? Answer: you don't.
     
    Since you provided woefully incomplete information. we have to guess. You
    shouldn't be shouting at me for that. You never said anyhthing about
    casting a 'String[]' because you didn't say what type 'bar' is. So get off
    your bloody high horse, bubba.
     
    Since you didn't tell us at all yet, what is the type of 'bar'?

     
    > > You might find the Java tutorials informative.
     
    > Again, read what I posted. How many Java books did I go through? I lost
    > count.
     
    Zero.
     
    Or you wouldn't have made the mistake you did, Mr. Attitude.

     
    > > > when I get to them.
     
    > There...see, I said it again. I hadn't gotten being List<String> and
    > String[]. Read what you're replying to next time. :-)
     
    Boy, you love to be rude, don't you?
     
    Do you think a smiley makes your comment less obnoxious?
     
    I ask again, what was the type of 'bar'?
     
    You cop all this attitude, bu you leave out the vital datum.

     
    > will
    > > do that switch for you.
     
    > Did I say ANYTHING about switching based on variable types? No. I was
     
    Yes, you said and quoted again, "A simple switch() in onItemClicked will
    determine which type of settings are in effect".
     
    What kind of "type" did you mean?

     
    > was. In other words, if spinner item #2 is "Incandescent" then I know
    > that the spinner's current data set is White Balance settings.
    > Understand now? :-)
     
    I understand that you are obnoxious. Smiley faces don't reduce your
    rudeness, Flame Boy.
     

     
    > it? Hmmmm? Read *what I wrote*. If you're trying to read my MIND,
    > instead, you're doing an absolutely miserable job of it. Even my CATS
    > do better than that (actually, they do really well at it). :-)
     
    You are pathetic.
     
    --
    Lew

     

    Kostya Vasilyev <kmansoft@gmail.com> Mar 30 01:38AM +0400  

    > thought, in my response, that I made my appreciation for that clear.
    > Apparently, I didn't make that as clear as I thought I did. Apologies,
    > Kostya, for not making my appreciation for your help clear.
     
    No aplogies needed - you were quite clear indeed.
     
    In fact, I need to apologize for calling "obj.toString()" a typecast in my
    original message. It's not, of course, rather it's a method call.
     
     
     
     
    > I still have some reading to do, but Kostya put me on the right track,
    > which is exactly what I needed, and what I was looking for.
     
    Sure seems that you do, but then -- you're an adult and I'm not your
    mother, so I'm not going to reproach you for having had to ask in the first
    place :)
     
    Almost anyone gets stuck and needs a bit of help with something sooner or
    later.
     
    That's cool, it's what this list is for.
     
    -- K

     

    mike digioia <mpd395@gmail.com> Mar 29 02:10PM -0700  

    Anyone out there worked with the Maven tools? I am having trouble adding
    jar files since I can't locate the necessary parameter needed by "mvn
    install:install-file" command. I Google it but no one says where to get
    this info? Do I need to look at the binary JAR file? I attempted to make up
    the number I could not find and it worked except the claasses in the JAR
    are still not known to resolve references in my code.
     
     
     

     

    Kristopher Micinski <krismicinski@gmail.com> Mar 29 05:13PM -0400  

    These are fairly basic questions, and are all answered at the SDK website.
     
    http://developer.android.com/sdk/index.html
     
    You then have to set an appropriate API level for your app, to make
    sure you're not including things you don't want, etc..,
     
    kris
     

     

    mike digioia <mpd395@gmail.com> Mar 29 02:23PM -0700  

    I am not using eclipse where it is all detailed at this site. I am using
    the Maven environment instead that uses command line. Have you used Maven
    before?
     
    On Thu, Mar 29, 2012 at 2:13 PM, Kristopher Micinski <krismicinski@gmail.com

     

    Pinheiro <rui.c.pinheiro@gmail.com> Mar 29 02:02PM -0700  

    I have this simple XML in the drawable folder:
     
    <selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/dark_pressed"
    android:state_pressed="true" />
    <item android:drawable="@drawable/dark_focused"
    android:state_focused="true"
    android:state_enabled="true"
    android:state_window_focused="true" />
    <item android:drawable="@drawable/dark" />
    </selector>
     
    And I'm getting the error in Eclipse:
    Binary XML file line #2: <item> tag requires a 'drawable' attribute or
    child tag defining a drawable
     
    Anyone knows what the problem is? I've tried to clean the project and
    restarting Eclipse but nothing worked.
     
    Thanks in advance!

     

    Spica <spicanebula@gmail.com> Mar 29 09:22AM -0700  

    Guys,
    How i can save GPS locations while i am walking? I will be displaying
    my walking track which i will recording while walking. Where i would
    be saving all those huge number of locations on my phone?
    There are few apps in the market who are doing that, please share your
    ideas how and where they save this data?
     
    Thanks,

     

    lbendlin <lutz@bendlin.us> Mar 29 09:59AM -0700  

    Nothing huge about it. You only get one data row per second max. SQLite is
    laughing at that.
     
    On Thursday, March 29, 2012 12:22:47 PM UTC-4, Spica wrote:

     

    Spica <spicanebula@gmail.com> Mar 29 12:29PM -0700  

    Hmm... would be expenssive on battery coz GPS would be working all
    that time.
     
    Any different idea?
     

     

    Kristopher Micinski <krismicinski@gmail.com> Mar 29 03:37PM -0400  

    Yes, having GPS going on a lot will be bad for your battery..., you
    have to live with it.
     
    You can try getting the location from a passive provider, but that's
    somewhat spotty, of course..., If you want to use GPS, you have to be
    willing to pay the price..
     
    kris
     

     

    JackN <jack@jacknorth.com> Mar 29 11:51AM -0700  

    I would just rename. MS does that in IE when they want to suppress
    something they don't like. Same with EPS files and others. APK is zip,
    but by renaming, MS gets to complicate anyone's life that is trying to
    download via IE and isn't aware.
     

     

    Lew <lewbloch@gmail.com> Mar 29 11:18AM -0700  

    Remote Red wrote:
     
    > That is not the bom for utf-8. You wrote the bom for UTF-16.
     
    > http://en.wikipedia.org/wiki/Byte_order_mark
     
    > The bom for utf-8 is 0xEF, 0xBB, 0xBF.
     
     
    And that same article reminds us,
    "The Unicode standard recommends against the BOM for UTF-8.[26]<http://en.wikipedia.org/wiki/Utf-8#cite_note-25>
    "
     
    It also says that the need for it is something Notepad decided despite that
    it violates the recommendation.

     
    > You are not done before it works with the right bom.
     
    Which ought to be no BOM at all.
     
    --
    Lew

     

    Karim Varela <karim.varela@gmail.com> Mar 29 10:54AM -0700  

    Is there any way to dynamically view the application specific cache in
    Android? I'm saving images to the cache (/data/data/my_app_package/cache)
    and I'm 99% sure they're saving there, but not sure how long they're
    staying around.
     
    When I look in the cache using the DDMS File Explorer within Eclipse, it's
    always empty. I've also tried examining the appropriate cache dir in ADB
    and again it's always empty.
     
    Any suggestions?

     

    Justin Anderson <magouyaware@gmail.com> Mar 29 11:05AM -0600  

    Please don't post the same message multiple times...
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     

     

    Bozzified <bozidar@gmail.com> Mar 29 10:04AM -0700  

    Hello everyone.
     
    I am trying to get a hang of XML parsing and can't get this to show me the
    right elements as I'm fairly new to Android/Java dev. Would appreciate
    some guidance.
     
    I've build a class that gets the custom xml url and needs to parse it and
    fill ArrayList with values. After trying several versions I can't wrap my
    head around parsing nodes and extracting element values.
     
    This is what I have
     
    DocumentBuilderFactory factory = DocumentBuilderFactory.*newInstance*();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document doc = builder.parse(feedURL);
     
    // get xml document root element
    Element root = doc.getDocumentElement();
     
    // get node list of all elements with tag name item
    NodeList items = root.getElementsByTagName("item");
     
    ArrayList<String[]> photoSet = *new* ArrayList<String[]>();
     
    *for* (*int* i = 0; i < items.getLength(); i++) {
     
    Node itemNode = items.item(i);
     
    NodeList itemChildNodes = itemNode.getChildNodes();
     
    Node itemChildNode = itemChildNodes.item(2);
     
    String value = itemChildNode.getNodeValue();
     
    Log.*d*("ITEM ELEMENT VALUE", "Node value for item["+i+"]
    -> "+value);
     
    }
     
    here's what the XML looks like:
     
    <gallery>
    <item> <photoid>509</photoid> <url>
    http://a2.sphotos.ak.fbcdn.net/hphotos-ak-ash4/320622_10150298438271744_326149431743_8468654_1542995730_n.jpg
    </url> <title>Foster The People DC</title> <description></description>
    <category></category> <dateupdated>2012-01-24 23:31:58</dateupdated>
    <dateupdated2>Wed Jan 25 07:31:58 GMT-0800 2012</dateupdated2>
     
    </item>
     
    <item> <photoid>508</photoid> <url>
    http://a8.sphotos.ak.fbcdn.net/hphotos-ak-ash4/308152_10150298438346744_326149431743_8468655_312468158_n.jpg
    </url> <title>Foster The People Philly</title> <description></description>
    <category></category> <dateupdated>2012-01-24 23:31:44</dateupdated>
    <dateupdated2>Wed Jan 25 07:31:44 GMT-0800 2012</dateupdated2></item>
    </gallery>
     
    So now why I put itemChildNodes.item(2) is basically because I thought that
    would give me back 3rd subchild element of that node which is in this case
    <title> tag under <item> node
     
    Would someone be kind enough to educate me on why this is not working and
    what's the best way to do this. The reason I'm not using SAX is because
    these XML files will be fairly small so I went with DocumentBuilder and
    also I wanted to learn both ways.
     
     
    Many thanks good people.

     

    Justin Anderson <magouyaware@gmail.com> Mar 29 10:33AM -0600  


    > When I recently switched to a new computer and created a new keystore
    > and various alias keystores, my release keys no longer work.
     
    Why did you do that? I have switched computers multiple times but have
    never done that. Just keep a copy of your original release .keystore file
    backed up somewhere and you never have a problem.
     
    Thanks,
    Justin Anderson
    MagouyaWare Developer
    http://sites.google.com/site/magouyaware
     
     

     

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