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

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

    TreKing <trekingapp@gmail.com> Oct 30 08:21PM -0500  

    On Tue, Oct 30, 2012 at 6:47 PM, Carlos A. M. dos Santos <
    > library.
     
    > > But we directly want to open it from assets folder.
     
    > Doesn't <some-context-instance>.getAssets().open(assetName) work for you?
     
     
    As you said, reading PDFs is not a native feature and requires an external
    app, which would not have permission to read the PDF from another app's
    Assets folder.
     
    I believe the OP would have to write his own PDF viewer imbedded in his
    app, or stick with the "copy to SDcard then open" strategy.
     
    -------------------------------------------------------------------------------------------------
    TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
    transit tracking app for Android-powered devices

     

    Sheado <chadata@gmail.com> Oct 30 06:35PM -0700  

    hey peoples,
     
    On 4.0.3 if I start an activity for an ACTION_VIEW (for an http url)
    without an intent chooser then I get the following weird behavior in the
    following order:
     
    1. start browser
    2. my activity: onPause()
    3. my activity: onResume()
    4. my activity: onPause()
    5. at this point the browser is loaded up fine - but my app went through
    an unnecessary (and potentially sluggish) restart
     
    If I use an Intent chooser and pick any browser that comes up, this issues
    doesn't happen (e.g. no weird restart).
     
    Is this an Android bug? I'm not seeing this issue on older versions of
    Android.
     
    Any ideas?
     
    Thanks!
     
    -Chad

     

    Mark Phillips <mark@phillipsmarketing.biz> Oct 30 03:49PM -0700  

    As a newbie, I was wondering if layouts are reusable. For example, say I
    have Activities A and B, and they both have the same layout for the screen.
    So I create Layout L in the file my_layout.xml, which has a Textfield with
    @id+/textfield1 in the layout and it is blank.
     
    In the onCreate() of both Activities A and B, can I have the line
    setContentView(R.my_layout)? Will there be any issues when switching from
    one Activity to the other?
     
    Will I have issues accessing the Textfield with id textfiel1? If the user
    sets the value Activity A and I save it somewhere (say in the Application
    object), then when I display Activity B, textfield1 should be blank. Right?
     
    Other than one less layout file, am I really saving any resources by having
    one layout file?
     
    Or, is it better practice to create two layout files, one for each
    Activity, and to have two unique textfields in these two layouts.
     
    Thanks,
     
    Mark

     

    Mark Phillips <mark@phillipsmarketing.biz> Oct 30 05:08PM -0700  

    Thanks for your response.
     
    What happens to the ids of the elements in the layout? Will I have one id
    for the TextViews in my example, so when I do something to it (change the
    color or text, for example), will all the TextViews in all the layouts
    change? I guess it will not matter on a small screen as there will only be
    one activity at time.
     
    What if I use fragments and have two fragments on the screen at the same
    time with the same layout for each fragment. Then there are two active
    TextViews with the same id....is this an issue? If I change one, will both
    change?
     
    Thanks!
     
    Mark
     

     

    Romain Guy <romainguy@android.com> Oct 30 03:56PM -0700  

    You can reuse XML layouts (just like you can reuse any resource.) When you
    use a layout resource (with setContentView() for instance) it gets
    "inflated." This means the layout is parsed and converted into actual View
    objects. If you reuse the same layout in several activities, you will
    simply create several sets of View objects that all have the same
    characteristics.
     
     
    On Tue, Oct 30, 2012 at 3:49 PM, Mark Phillips
     
    --
    Romain Guy
    Android framework engineer
    romainguy@android.com

     

    huberte <svend.walter@gmail.com> Oct 30 06:25PM -0700  

    thanks a lot bob, for your answer
     
    Le mardi 30 octobre 2012 12:04:29 UTC-4, bob a écrit :
     
    > Please see the following method in this class:
     
    > *android.graphics.Bitmap*
     
    I did not need this, when programming in eclipse :
     
    ImageView image = (ImageView) findViewById(R.id.imageview);
     
    And voilà, autofit, autosize, autoscale :) and clean image.
     

     
     
    > Note you will probably have to get rid of your WebView approach.
     
    I cant, this time I need to do a web app, beacause of the many teachers
    beta testing, and then using it.
     
    try it
     
    http://www.sciences-physiques.eu/appli/carimage/
     
    you have one image in image and 3 in carimage (carousel)
     
    the result is horrible in the stock browser, not so bad in chrome on my
    sgs2.
     
    why ?

     

    "Carlos A. M. dos Santos" <unixmania@gmail.com> Oct 30 10:16PM -0200  

    > Eu sou novo em desenvolvimento mobile mas estou conseguindo criar meu
    > aplicativo.
     
    The accepted language in this discussion group is English. You will
    not get any help writing in Portuguese,
     
    > esse usário)
    > Tentei utilizar a API twitter4j, mas como sou novo na área, não descobri
    > como fazer.
     
    Please ask in the twitter4j suport forums. Your problem is not related
    to the Android framework neither to the Android SDK.
     
    > Pensei em até redirecionar para URL do usário, mas também não consegui
    > descobrir como redirecionar para uma pagina em JAVA.
     
    You must use an Intent to invoke the browser (or any suitable
    application to do the job).
     
    > Se alguém souber como me ajudar eu fico muito agradecido.
     
    Não espera que eles vão aprender Português só pra te ajudar.
     
     
    --
    "The flames are all long gone, but the pain lingers on"

     

    Daniel <greywanderer012345@gmail.com> Oct 30 05:14PM -0700  

    I have an education app that is small, cheap, but useful. As a developer, I
    advertise that I am a pre-health student myself. I feel that about 1/15 of
    my buyers are likely curious professors who might respond to a donate
    selection in the options list. I don't plan on putting the donate button in
    the way of the app, nor will it unlock any features. I would also be using
    the "In App Products" service to "sell" the donation. However, I am
    wondering whether the Billing permission would drive away as many users as
    I would get donations. Does anyone have any advice for me? Thank you.

     

    bob <bob@coolfone.comze.com> Oct 30 02:28PM -0700  

    Sounds like you want a java.util.Timer
     
     
    On Tuesday, October 30, 2012 2:41:05 PM UTC-5, marcpolo wrote:

     

    Lew <lewbloch@gmail.com> Oct 30 02:46PM -0700  

    bob wrote:
     
    > Sounds like you want a java.util.Timer
     
    http://developer.android.com/reference/java/util/Timer.html
    "This class does not offer guarantees about the real-time nature of task
    scheduling."
    "Prefer ScheduledThreadPoolExecutor<http://developer.android.com/reference/java/util/concurrent/ScheduledThreadPoolExecutor.html> for
    new code."
     
    marcpolo, this illustrates why you should take advice with a grain of salt
    and a
    pound of verification.
     
    'Timer' does not guarantee an exact interval, thus does not solve the OP's
    problem.
     
    marcpolo wrote:
    > public void run()
    > {
    > m_handler.postDelayed(this, (int)m_samplePeriod_ms);
     
    Underscores in variable names violate the Java Coding Conventions, with the
    exception of constant variables.

     
    > Galaxy S3.
     
    > Are there other alternatives? I have tried using a thread but I run into
    > problems when I try to update the UI.
     
    What do you mean "tried using a thread"? Show us the code.
     
    You certainly don't want to put that delay on the GUI thread.
     
    Timing in a non-real-time system is approximate.
     
    --
    Lew

     

    marcpolo <marc.armstrong89@gmail.com> Oct 30 05:10PM -0700  

    Thanks very much for the feedback.
     
    When I mentioned that I used a thread, I meant that I extended the Thread
    class with the run() method being overriden. I'm at home at the moment so
    can't show some code. Basically I would start/stop the thread from a button
    'click' handlers. Inside the Run() method was simply a loop to perform the
    range measurements and sleep for the remainder of the 25ms. This solution
    didn't work because I couldn't update the UI entities from this thread.
    Runnable seems to be the better option for accessing views.
     
    I appreciate that android is not a realtime system but thought that 40Hz
    wouldn't be too difficult to achieve, with the occasional overrun, which
    wouldn't impair my app. I am getting nowhere near this - even when I remove
    the range measurement functionality from the run method.
     
    I'll investigate both the timer and scheduledThreadPoolExecutor.
     
    Thanks again.
     
    Marc

     

    Kristopher Micinski <krismicinski@gmail.com> Oct 30 08:14PM -0400  

    > wouldn't be too difficult to achieve, with the occasional overrun, which
    > wouldn't impair my app. I am getting nowhere near this - even when I remove
    > the range measurement functionality from the run method.
     
    It's not that it's "too difficult to achieve," it's just that for most
    circumstances it's easier and more efficient to schedule with very
    loose timing guarantees. So this isn't really the framework's fault,
    per se, it's more of a "feature" :-)...
     
    kris

     

    "S.T.V. Ingeniería" <ingenieria.stv@gmail.com> Oct 30 07:41PM -0300  

    The problem is that i can't cast my custom EditText to a EditText in my
    adapter. Or, saw it from a diferent point, i can´t place my custom EditText
    in my Layout.
     
    Thanks for answer me anyway.
     
    2012/10/29 Lew <lewbloch@gmail.com>
     
     
    --
     
    *San Francisco - Córdoba - Argentina*
    *CP: 2400*
    *TE: 03564-15561617 - 15599945*

     

    Jan Burse <janburse@fastmail.fm> Oct 31 12:40AM +0100  

    tete schrieb:
    > I want to override the OnKeyPreIme method of a EditText got from a
    > findByView(int id), to make the activitiy finish() when user press back key.
     
    You can override the back key of your activity(*), and make
    the finish call dependent on the focused view, i.e. check
    whether the user is inside the edit text.
     
    Bye
     
    (*)
     
    public void onBackPressed ()
    Added in API level 5
     
    Called when the activity has detected the user's press of the back key.
    The default implementation simply finishes the current activity, but you
    can override this to do whatever you want.
     
    http://developer.android.com/reference/android/app/Activity.html#onBackPressed%28%29

     

    Lew <lewbloch@gmail.com> Oct 30 05:01PM -0700  

    tete wrote:
     
    > adapter. Or, saw it from a diferent point, i can´t place my custom EditText
    > in my Layout.
     
    > Thanks for answer me anyway.
     
    Thanks for not answering me anyway.
     
    How do you expect help without interacting with those trying to help you?
     
    I asked questions. I would be glad to try to help you if you answered them.
    Please
    consider doing so. Since you have refused so far, I am much less glad.
     
    --
    Lew

     

     

    Daniel <greywanderer012345@gmail.com> Oct 30 05:00PM -0700  

    You can sell physical items through any method you want, including paypal.
    You can even sell some part of a service, such as those credits you
    mentioned. The policy is very very clear that the only thing you absolutely
    HAVE to use the "In App Products" service to sell are actual features in
    your app itself. If Blizzard made a WoW app, there could be an option to
    pay your WoW bill from the app (as long as that isn't all the app could
    do). For physical items though, I'd suggest using google checkout. Google
    bots won't be so quick about assuming you're doing something wrong.
    Checkout charges *30% *for* In App Purchases*, but for* physical items *they
    charge* 2.90% + $0.30.*

     

    bob <bob@coolfone.comze.com> Oct 30 03:23PM -0700  

    Well, according to my GIF Animator program, it was encoded to loop
    infinitely.
     
     
    But, it didn't on Android.
     
     
    Using a large number (i.e. 100,000) for the loop count seems to be a good
    enough workaround for now.
     
     
     
    On Monday, October 29, 2012 3:10:02 PM UTC-5, bob wrote:

     

    TreKing <trekingapp@gmail.com> Oct 30 06:10PM -0500  


    > Well, according to my GIF Animator program, it was encoded to loop
    > infinitely.
     
    > But, it didn't on Android.
     
    Here's a tip: if something should work correctly, but doesn't, and you've
    thoroughly debugged your own app, check b.android.com for a possible bug in
    the framework.
     
    -------------------------------------------------------------------------------------------------
    TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
    transit tracking app for Android-powered devices

     

    Daniel <greywanderer012345@gmail.com> Oct 30 04:30PM -0700  

    Admob and others use the CTR when determining what bids to give your app,
    or to give any at all. If you have a small CTR, all of your users will see
    less ads, and ads with lower bids. As a result, users who are likely to, or
    do click on ads, will see fewer ads, and those they do see and click on are
    more likely to be lower bids.

     

    Iroid <irfan.f.khan@gmail.com> Oct 30 04:10PM -0700  

    Hello Everyone,
    I have to create a custom account in Android that
    will be integrated with Account and Sync framework.
    By default Account Manager caches the Auth token and
    returns the same for all request.
    Is there any way to change this default behavior, I
    do not want Account Manager to cache the token.
    Please let me know.
     
    Thanks in Advance.
     
    Regards,
    Irfan

     

    pushbit <pushbit@gmail.com> Oct 30 03:36PM -0700  

    I'm having a problem where an EditText in landscape/full screen mode
    becomes empty after turning the screen off and then on when the system
    Screen lock is set to 'None'. The keyboard remains active, but it doesn't
    appear to have focus and no text updates are displayed on the screen. If I
    press 'Done' or rotate to portrait, then the full screen editor is removed
    and I can see the previously entered text in the normal EditText view. I'm
    reproducing this on JB on both the emulator and a device.
     
    I found the same problem in Calendar, but not in Messaging. When editing
    an SMS message in landscape/full screen mode and then turning the screen
    off/on, at first the message appears to be empty, but then it returns after
    a second. I reviewed the source code below, but I didn't see anything
    special in onResume() that looked to be addressing this issue.
     
    https://github.com/android/platform_packages_apps_mms/blob/master/src/com/android/mms/ui/ComposeMessageActivity.java
     
    Does anyone know how to properly fix this, so that when Screen lock is
    'None' you can edit text in landscape/full screen mode, turn the screen off
    and then back on, and the text is displayed just as you left it?
     
    Thanks,
    pb
    ----
    Open Source Android App
    Dining Out (with friends)<https://play.google.com/store/apps/details?id=net.sf.diningout>

     

    pushbit <pushbit@gmail.com> Oct 31 12:01AM +0100  

    Yes, the EditText has an android:id. I've found this problem with a
    variety of EditText and AutoCompleteTextView configurations, but only when
    the system Screen lock setting is set to 'None'. Everything works fine
    when it's set to Slide or Pattern, so I suspect that the lack of a screen
    lock is the source of this problem. Though if possible, I would like to
    find a way to work around this, as the Message app seems to be able to do.
     

     

    Kostya Vasilyev <kmansoft@gmail.com> Oct 31 02:18AM +0400  

    I think you should be able to retrieve the icons from the network
    ahead of time / on demand, save to disk, and serve as content:// type
    URIs in the column you mentioned (this can work on Android 2.2 and
    higher).
     
    Another way: the framework's SearchRecentSuggestionsProvider uses an
    "android.resource://system" type URI, so you might be able to do this
    as well, for a fixed set of most often used icons, using a
    "resource://" URI that references your package.
     
    -- K
     

     

    John Coryat <coryat@gmail.com> Oct 30 02:20PM -0700  

    More info:
     
    By recording the GCM API Key: "Key for browser apps (with referers)" the
    project number itself is recorded. Most likely, the developer console is
    using the browser key to verify and retrieve the project Id for statistics.
    Makes sense.
     
    Perhaps the documentation in the developer's console could be improved to
    include this bit.
     
    -John Coryat

     

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

No comments:

Post a Comment