[android-developers] Digest for android-developers@googlegroups.com - 13 updates in 6 topics

Comments: (0)

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

    Yuvi <testandroidos51@gmail.com> Mar 31 10:45PM -0700  

    Hi Andrew,
     
    Is it good idea to create constructor of Android Component classes ?
    I have read somewhere that we should never create constructors for Android
    Component classes.
     
    Regards,
    Yuvi
     
     
    On Wednesday, March 26, 2014 11:48:31 PM UTC+5:30, Andrew Mackenzie wrote:

     

    Ted Hopp <ted.hopp@gmail.com> Mar 31 06:32PM -0700  

    We have an app that uses the following license policy:
     
    - if a definitive response of LICENSED is stored in the app's
    preferences and has not expired, allow access.
    - if a definitive response is not stored in the app's preferences, or if
    it has expired, or if the cached response is NOT_LICENSED, request a
    license check from the server.
    - if a definitive response (LICENSED or NOT_LICENSED) is received, it is
    stored in the prefs, along with the license validity period returned by the
    server. Access is permitted if the definitive response is LICENSED.
    - if anything other than a definitive response is received (airplane
    mode, server error, etc.), the last stored definitive response is used to
    determine access, even if expired. If no response is stored, allow access.
     
    (This is basically the same as the LenientPolicy described in this thread<https://groups.google.com/forum/#!searchin/android-developers/%22NOT_LICENSED%22$20response/android-developers/Pg1R5COMLD8/mBiKJyUxp0MJ>.
    We're aware of its weaknesses, but generally it works for us.)
     
    The problem is that we occasionally receive reports of customers being
    denied use of the app due to a license problem. These are installations
    that definitely should be receiving a server response of LICENSED. When the
    problem happens, and when we've been able to obtain details, it always
    turns out that the user's device was not fully connected. When full network
    connectivity was restored, the app ran fine. Here's (part of) a report from
    a customer who has been unusually helpful:
     
    I'm using an Acer Iconia A500 tablet, running Android 4.0.3, kernel
    2.6.39.4+. . . . So, I don't seem to be able to simulate it with airplane
    mode on. I also tried turning airplane mode back off, and it works fine
    right now. The situation where this happened to me it happened three
    different times, it was during a reading group at another person's house,
    and I don't have any access to their wifi network. So, there was wifi in
    the area, but I wasn't connected to any at all, but I wasn't on airplane
    mode either. . . If it happens again, I will try to watch more closely and
    take note of any network circumstances.
     
    We have not been able to reproduce the problem on either an emulator or on
    our test devices. As far as I can tell from our code, our app will always
    run unless it receives a response of NOT_LICENSED from the license client.
    Our assumption had been that this was only possible if the licensing client
    successfully contacted the license server and received a response of
    NOT_LICENSED (or had an unexpired NOT_LICENSED server response previously
    cached). But perhaps our assumption is wrong. Is there any situation where
    the licensing client on the device will return a response of NOT_LICENSED due
    to a communication problem (or any other reason besides having received
    that response from the license server)? Is there anything we could ask the
    customer to do that might help sort out what's going wrong?

     

    Marina Cuello <marina.eariel@gmail.com> Mar 31 06:01PM -0300  

    No, there are a few devices with a BlackBerry-like / QWERTY format that
    have 4:3 screens. Samsung Galaxy Y Pro is one I can recall. But they're
    exceptions, I believe.
     
    Marina
     
     

     

    NewToAndroid <rahulrasal@gmail.com> Mar 31 04:19AM -0700  

    Hi all,
     
    I have this question out of curiocity.
    Android is based on Linux, which is basically written in C. Why Android apps are not written in C ? Why Java?
     
    I accept that , I might have big gaps in my understanding of Android, which is what I want to clear.
     
    Thanks in advance

     

    Sai Yamanoor <yamanoorsai@gmail.com> Mar 31 09:40AM -0500  

    Someone might correct me if I am wrong here. I learned that they chose Java
    to meet performance requirements. There is a detailed explanation behind
    how the use of Java affects the device performance.
     
    Sai
     
     

     

    Nikolay Elenkov <nikolay.elenkov@gmail.com> Apr 01 12:04AM +0900  

    > Someone might correct me if I am wrong here. I learned that they chose Java
    > to meet performance requirements. There is a detailed explanation behind how
    > the use of Java affects the device performance.
     
    Because Java is a language that is both high-level enough, so that
    it's somewhat
    hard to shoot yourself in the foot, and still low-level enough to be usable for
    system programming.
     
    Also writing UI code is much easier using some OOP features, otherwise you
    end up with function pointers-to-function-pointers with dozens of parameters
    ala GTK.

     

    NewToAndroid <rahulrasal@gmail.com> Mar 31 12:27PM -0700  

    Thats good to know. My intension behind asking this question was, will the apps be faster if written in C/C++ ?
    But looking at the intro of NDK, they say it won't give significant performance improvement if apps developed in c/c++.
    Is it because of the layers of basic Android architechture? Or what?
    Any ideas please.

     

    Kristopher Micinski <krismicinski@gmail.com> Mar 31 04:18PM -0400  

    One big reason is that a lot of time is spent in system libraries,
    which are written in C/C++. I believe in the original talk on Dalvik,
    it was indicated that 70% of the time was spent in non-interpreted
    code. You also have to remember that Dalvik has a JIT compiler and now
    an LLVM based runtime (still in development, it seems), so the impact
    from Java is less than you might think.
     
    Kris
     
     

     

    limtc <thyechean@gmail.com> Mar 31 02:21AM -0700  

    I found the solution... set SDK Manager options to force HTTPS and the
    options will show up!
     
    在 2014年3月31日星期一UTC+8下午3时40分47秒,limtc写道:

     

--
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
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[android-developers] Digest for android-developers@googlegroups.com - 3 updates in 3 topics

Comments: (0)

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

    "Teo [GD API Guru]" <teominator@gmail.com> Mar 30 05:48AM -0700  

    Hi,
     
    maybe someone has an idea, i'm looking for an answer for ages but no luck.
     
     
    I have my main activity A and when the user presses a button i open another
    activity B. But when this happens B doesn't just appear on top of A:
    - A disappears
    - secure keyguard shows up
    - B appears
     
    And when i get rid of B the same thing happens. This is annoying because
    there's a lot of flickering with no real purpose on the screen. Is there
    any way to achieve direct transition from A to B while keyguard is active
    without merging the 2 activities into 1?
    Thanks,
    Teo

     

    dani maoz <maoz.dani@gmail.com> Mar 30 03:06PM +0300  

    Hi
    I was able to add functionality to Power button switch, but I still get
    the Power off screen displayed , how can I disable the default
    functionality of Power off button.
     
    Another question I would like to disable screen off when Power button
    pressed
    I tried Wakelock
     
    PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
    PowerManager.WakeLock wl =
    pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag");
    wl.acquire();
    ..screen will stay on during this section..
    wl.release();
     
     
    and it didn't work also tried this
     
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
     
    and it didn't work
    thanks in advance

     

    Terry <terboel@gmail.com> Mar 30 04:29AM -0700  

    As my app ("Thief Face Trap Mini", TFTM, com.terboel.tftm) does not seem to
    have any more spy-like features than similar apps - such as "Wheres My
    Droid", "Android Lost", "Prey", "Find My Phone", "GotYa Face Trap &
    Security", or even "Avast Anti-theft" - I assume that it was NOT removed
    because of its features. Then it must have been removed because Google
    suspected that it contained a virus (or malware).
     
    When I started scanning this app using different AntiVirus apps, I saw to
    my surprise that some of them indeed listed it as a Virus. Some even
    characterized it as a Trojan!
     
    See
    https://www.virustotal.com/en/file/6346C6F089551B8D3DE3EF80D44134DCBC1FB3DC5E7D1DF44A0B19A6BBA490CC/analysis/
    where I also have posted a comment. This is a web site owned by Google,
    where anyone can scan an app using most known AntiVirus apps.
     
    As I have witten all of this app myself, I am quite certain that it does
    NOT contain any virus or malware.
     
    It seemed that some AntiVirus app first THOUGHT that it detected a virus in
    mye app - possibly because it at some time contained a string with the
    letters LMPM, which MAY (incorrectly) have been associated with a LMPM
    Windows Trojan Virus. As many of the AntiVirus Apps copy from each other,
    it was not long before several of them reported my app as being a high risk
    virus or malware.
     
    I tried to appeal to Google, claiming that any virus listing must be caused
    by a FALSE POSITIVE, but Google said that they would not reinstate the app,
    and that their decision was not appealable.
     
    So, now I have started trying to get the AntiVirus publishers to REMOVE my
    app from their list of viruses and malware. Which is much harder than I
    though.
     
    So far a few publishers of AntiVirus Apps have tested it - and removed it
    from their list of viruses. That includes BitDefender, QuickHeal and
    ForeSafe. E.g. check this:
     
    http://sandbox.foresafe.com/2014/03/comterboeltftm_5.html
     
    Others do not even reply to my removal request, and some even claim that my
    app is really a virus - or at least a PUP (Potentially Unwanted Program) or
    PUA (Potentially Unwanted Application). Strangely enough, they seem to be
    unwilling to remove a FALSE POSITIVE. One should think that it would
    increase the quality of their AntiVirus Apps - and make them more
    trustworthy, but I do not understand how they are thinking. After having
    seen how lightly some of them list an innocent app as a virus, I have
    doubts about their quality.
     
    I write this because it may be of interest of other app developers - as it
    could easily also happen to their apps - and because I hope that the Google
    Play Support may also read this. If I should ever succeed in removing this
    app from being listed (as a virus) by ALL Android AntiVirus Apps, I still
    hope to get Google to reinstate my app.
     
    Regards, Terry
     
     
    On Tuesday, March 11, 2014 7:24:58 AM UTC+1, Terry wrote:

     

--
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
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[android-developers] Digest for android-developers@googlegroups.com - 2 updates in 2 topics

Comments: (0)

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

    dashman <erjdriver@gmail.com> Mar 29 12:48PM -0700  

    I've got a main activity that starts it's own service - if it's not already
    started
    by the system on boot.
     
    Right now I'm doing the bindService() call in onStart() and
    unbind in onStop().
     
    The problem is onStart() calls do not match onStop() - no 1:1 correlation.
    Activity life-cycle explains that.
     
    So where should I put them - onPause() onResume() ???
     
     
    Also when I call bindService() - I call startService() - incase it's not
    already started.
    Is that ok???
     
    bindService(intent, context, this, Context.BIND_AUTO_CREATE );
    startService( intent );
     
    If it's already started by the system - it won't create another service -
    right???

     

    dashman <erjdriver@gmail.com> Mar 29 09:32AM -0700  

    My app locks and unlocks the lock screen.
     
    I unlock/disable lock - by calling deviceManager.resetPassword( "",
    DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY );
     
     
    Next time the screen is turned on - the user gets a lock screen with no pin
    input requirement - just has to slide it.
     
    Happens just once.
     
    Any way for this lock screen not to be displayed.
     
     
    Also - can someone explain the second parameter - what's the difference
    between setting it and 0.
     
    Thanks.

     

--
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
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[android-developers] Digest for android-developers@googlegroups.com - 11 updates in 9 topics

Comments: (0)

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

    Gary Blakely <gdeanblakely@gmail.com> Mar 28 04:44PM -0700  

    I have just completed reading all sections of the GCM docs at
     
    https://developer.android.com/google/gcm/server.html
     
    I also have the GCMSource that I downloaded.
     
    But what I don't understand is how do I package my GCM Server? Where does
    it run? When I go live I would want to run it at my Webhoster where I run
    all of my other servers.
     
    The docs don't seem to touch on this. There is no "implementing" secion
    that I can find.
     
    (All my current apps are serviced by ASP.NET Web API REST services but I
    have never written or created a "java server".)
     
    Can someone give me a clue? Thanks, Dean

     

    Nathan <nathan.d.mellor@gmail.com> Mar 28 03:07PM -0700  

    Just had to accept it.
     
    Who has done a diff on it already?
     
    What has changed?
     
    Nathan

     

    Boris Burtin <bburtin@gmail.com> Mar 28 12:16PM -0700  

    I've had to go through some serious contortions in order to test my billing
    code. Here's a list of complications that I've run into:
     
    * There's no way for me to test subscriptions with my own account, because
    I can't buy from myself. As a result, I need a separate device with a
    separate account, using a separate credit card.
    * I couldn't find a way to debug my code, because billing requires a
    release build.
    * IabHelper doesn't detect cancelled subscriptions. Even after I cancel my
    subscription in Google Wallet, IabHelper reports it as "owned". So if I
    ever subscribe and want to go back to the unsubscribed state, I have to
    create another test subscription for my app.
    * Test subscriptions can't be deleted after they're activated, so the list
    keeps growing.
    * Managing subscriptions through the Google Wallet API is unintuitive. The
    UI doesn't show me the user login. The best I can do is to assume that I
    am the person in my zip code who purchased the subscription.
    * Changes to subscriptions take a while to propagate. Usually it's on the
    order of minutes, but the developer console says it can take hours.
     
    Is the process really as painful as I'm describing? I'd appreciate any
    suggestions to make billing development less painful.

     

    Doug <beafdefx@gmail.com> Mar 28 11:31AM -0700  

    On Thursday, March 27, 2014 2:04:24 AM UTC-7, Yuvi wrote:
     
    > You have to create your Handler in separate thread.
     
    That's not really true. You can use the Handler constructor that takes a
    Looper so that its work gets scheduled the thread represented by that
    Looper. For example, you could create a Handler against the main thread's
    looper from any other thread like this:
     
    new Handler(Looper.getMainLooper())
     
    Now that handler will schedule work on the main thread.
     
    Doug

     

    Jose_GD <jose.gonzalez.d@gmail.com> Mar 28 11:23AM -0700  

    Hi Brad, very kind of you, thank you!
     
    My apps:
    https://play.google.com/store/apps/developer?id=Jos%C3%A9+Gonz%C3%A1lez+D%27Amico
     
    The main app, Month Calendar Widget, is free and recently crossed the 2M
    mark, the other app is the first extension and is the only paid app I have
    for now. The second extension is for managing calendar events and hopefully
    will sell better.
     
    Best regards,
     
    José
     
    El jueves, 27 de marzo de 2014 18:32:00 UTC-3, Brad OHearne escribió:

     

    Simon Giddings <mr.s.giddings@gmail.com> Mar 28 12:44AM -0700  

    I agree, in the same way as using the relative alignments above.
    However, as I stated, the displayed text is *not* at the same position -
    the EditText widget is higer and so there are offsets applied to the
    beginning of the text.
     
     
    On Friday, 28 March 2014 00:21:52 UTC+1, yaturner wrote:

     

    Deepa M <deepam8900@gmail.com> Mar 28 12:22PM +0530  

    Hi All,
    How to Take a Screenshot of device Screen outside of my application without
    rooting the device.
    and if i root for taking screenshots and how can i non-root the device by
    program using android sdk..
     
     
    --
    Thanks& Regards
    Deepa M
    7795164152

     

    albertsmus <pliahas@gmail.com> Mar 27 11:10PM -0700  

    I found this code on net using-master detail fragments and i converted this
    to use actionbar tabs. when it works on portrait, it works ok. But when i
    change the orientation of the device i can'tsee the details fragment. The
    code and manifest file are below.
    First manifest file and after the java file:
    So is there any idea why is this happening?
    One more question. Is this design (tabs with master detail fragments) the
    right way to show records of "master" table and "detail" table? I mean if
    there is any disadvantage because of performance.
    Thanks for help
     
     
    <?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"package="edu.dartmouth.cs"android:versionCode="1"android:versionName="1.0" >
    <uses-sdk
    android:minSdkVersion="15"
    android:targetSdkVersion="17" />
    <application
    android:allowBackup="true"
    android:icon="@drawable/ic_fragments"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
    android:name="edu.dartmouth.cs.FragmentLayout"
    android:label="@string/app_name" >
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
     
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>
    <activity android:name="edu.dartmouth.cs.FragmentLayout$DetailsActivity" />
    <activity android:name="edu.dartmouth.cs.FragmentLayout$Details2Activity" /></application>
     
     
    // This code has some modifications to the original
    // See http://developer.android.com/guide/components/fragments.html
    // for a detailed discussion on the app
    // I don't recommend toast as debug for flow but why not do that to get started.
    // Better to use Log.d() which we introduced before. Toast is fleeting and logs
    // will always in in the LogCat -- hence they are more useful and better practice;
    // but you can't see them on the phone. It is sort cool to see onCreate() toast
    // as you flip the phone's orientation. It reinforces the lifecycle and the
    // automatic adjustment of the UI.
    //
    // ATC 2013
     
    package edu.dartmouth.cs;
     
    import java.util.ArrayList;
    import java.util.List;
     
    import android.app.ActionBar;
    import android.app.ActionBar.Tab;
    import android.app.ActionBar.TabListener;
    import android.app.Activity;
    import android.app.Fragment;
    import android.app.FragmentTransaction;
    import android.app.ListFragment;
    import android.content.Intent;
    import android.content.pm.ActivityInfo;
    import android.content.res.Configuration;
    import android.os.Bundle;
    import android.util.Log;
    import android.util.TypedValue;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.ArrayAdapter;
    import android.widget.ListView;
    import android.widget.ScrollView;
    import android.util.Log;
    import android.util.TypedValue;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.ArrayAdapter;import android.widget.ListView;import android.widget.ScrollView;import android.widget.TextView;import android.widget.Toast;import edu.dartmouth.cs.FragmentLayout.Titles2Fragment;import edu.dartmouth.cs.FragmentLayout.TitlesFragment;import edu.dartmouth.cs.apis.CopyOfShakespeare;import edu.dartmouth.cs.apis.Shakespeare;`
     
     
    // Demonstration of using fragments to implement different activity layouts.
    // This sample provides a different layout (and activity flow) when run in
    // landscape.
     
    `public class FragmentLayout extends Activity {
    //List<Fragment> fragList = new ArrayList<Fragment>();
    @Overrideprotected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //tab
    final ActionBar actionBar = getActionBar();
     
    // Specify that tabs should be displayed in the action bar.
    actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
     
     
     
    // Add 2 tabs, specifying the tab's text and TabListener
     
    Tab meinProfil = actionBar.newTab().setText("Mein Profil");
    TabListener<TitlesFragment> tabListenerMeinProfil = new TabListener<TitlesFragment>(this,"Mein Profil",TitlesFragment.class);
    meinProfil.setTabListener(tabListenerMeinProfil);
    actionBar.addTab(meinProfil);
     
    Tab mitglieder = actionBar.newTab().setText("Mitglieder");
    TabListener<Titles2Fragment> tabListenerMitglieder = new TabListener<Titles2Fragment>(this,"Mitglieder",Titles2Fragment.class);
    mitglieder.setTabListener(tabListenerMitglieder);
    actionBar.addTab(mitglieder);
     
    //
    Toast.makeText(this, "FragmentLayout: OnCreate()", Toast.LENGTH_SHORT)
    .show();
     
    // Sets the view. Depending on orientation it will select either
    // res/layout/fragment_layout.xml (portrait mode) or
    // res/layout-land/fragment_layout.xml (landscape mode). This is done
    // automatically by the system.
    if (savedInstanceState != null) {
    actionBar.setSelectedNavigationItem(savedInstanceState.getInt("tab", 0));
    }
    //setContentView(R.layout.fragment_layout);}
     
    @Override
    protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putInt("tab", getActionBar().getSelectedNavigationIndex());
    }
    private class TabListener<T extends Fragment> implementsActionBar.TabListener {
    private Fragment mFragment;
    private final Activity mActivity;
    private final String mTag;
    private final Class<T> mClass;
    private final Bundle mArgs;
     
    public TabListener(Activity activity, String tag, Class<T> clz) {
    this(activity, tag, clz, null);
    }
     
    /**
    * Constructor used each time a new tab is created.
    *
    * @param activity
    * The host Activity, used to instantiate the fragment
    * @param tag
    * The identifier tag for the fragment
    * @param clz
    * The fragment's Class, used to instantiate the fragment
    */
    public TabListener(Activity activity, String tag, Class<T> clz, Bundle args) {
    mActivity = activity;
    mTag = tag;
    mClass = clz;
    mArgs = args;
    // Check to see if we already have a fragment for this tab, probably
    // from a previously saved state. If so, deactivate it, because our
    // initial state is that a tab isn't shown.
    Log.d("pas 111", mTag.toString());
    mFragment = mActivity.getFragmentManager().findFragmentByTag(mTag);
    if (mFragment != null && !mFragment.isDetached()) {
    Log.d("pas", mTag.toString());
    FragmentTransaction ft = mActivity.getFragmentManager().beginTransaction();
    ft.detach(mFragment);
    ft.commit();
    }
    }
     
    public void onTabSelected(Tab tab, FragmentTransaction ft) {
    Log.d("pas 111", mTag.toString());
    // mFragment = mActivity.getFragmentManager().findFragmentByTag(mTag);
    if (mFragment == null) {
    mFragment = Fragment.instantiate(mActivity, mClass.getName(), mArgs);
    ft.add(android.R.id.content, mFragment, mTag);
    } else {
    ft.attach(mFragment);
    }
     
     
    }
     
    public void onTabUnselected(Tab tab, FragmentTransaction ft) {
    // mFragment = mActivity.getFragmentManager().findFragmentByTag(mTag);
    if (mFragment != null) {
    Log.d("pas unselected", mTag.toString());
    ft.detach(mFragment);
    //ft.commit();
    }
     
    }
     
    public void onTabReselected(Tab tab, FragmentTransaction ft) {
    // User selected the already selected tab. Usually do nothing.
    Toast.makeText(mActivity, "Reselected!", Toast.LENGTH_SHORT).show();
    }}
     
    // This is a secondary activity, to show what the user has selected when the// screen is not large enough to show it all in one activity.
    public static class DetailsActivity extends Activity {
     
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
     
    Toast.makeText(this, "DetailsActivity", Toast.LENGTH_SHORT).show();
     
    if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
    // If the screen is now in landscape mode, we can show the
    // dialog in-line with the list so we don't need this activity.
    finish();
    return;
    }
     
    if (savedInstanceState == null) {
    // During initial setup, plug in the details fragment.
     
    // create fragment
    DetailsFragment details = new DetailsFragment();
     
    // get and set the position input by user (i.e., "index")
    // which is the construction arguments for this fragment
    details.setArguments(getIntent().getExtras());
     
    //
    getFragmentManager().beginTransaction()
    .add(android.R.id.content, details).commit();
    }
    }}
    // This is the "top-level" fragment, showing a list of items that the user// can pick. Upon picking an item, it takes care of displaying the data to// the user as appropriate based on the current UI layout.
    // Displays a list of items that are managed by an adapter similar to// ListActivity. It provides several methods for managing a list view, such// as the onListItemClick() callback to handle click events.
    public static class TitlesFragment extends ListFragment {
    boolean mDualPane;
    int mCurCheckPosition = 0;
     
    // onActivityCreated() is called when the activity's onCreate() method
    // has returned.
     
    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
    // You can use getActivity(), which returns the activity associated
    // with a fragment.
    // The activity is a context (since Activity extends Context) .
     
    Toast.makeText(getActivity(), "TitlesFragment:onActivityCreated",
    Toast.LENGTH_LONG).show();
     
    // Populate list with our static array of titles in list in the
    // Shakespeare class
    setListAdapter(new ArrayAdapter<String>(getActivity(),
    android.R.layout.simple_list_item_activated_1,
    Shakespeare.TITLES));
     
    // Check to see if we have a frame in which to embed the details
    // fragment directly in the containing UI.
    // R.id.details relates to the res/layout-land/fragment_layout.xml
    // This is first created when the phone is switched to landscape
    // mode
     
    View detailsFrame = getActivity().findViewById(R.id.details);
     
    Toast.makeText(getActivity(), "detailsFrame " + detailsFrame,
    Toast.LENGTH_LONG).show();
     
    // Check that a view exists and is visible
    // A view is visible (0) on the screen; the default value.
    // It can also be invisible and hidden, as if the view had not been
    // added.
    //
    mDualPane = detailsFrame != null
    && detailsFrame.getVisibility() == View.VISIBLE;
    //mDualPane=true;
    Toast.makeText(getActivity(), "mDualPane " + mDualPane,
    Toast.LENGTH_LONG).show();
     
    if (savedInstanceState != null) {
    // Restore last state for checked position.
    mCurCheckPosition = savedInstanceState.getInt("curChoice", 0);
    }
     
    if (mDualPane) {
    // In dual-pane mode, the list view highlights the selected
    // item.
    getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    // Make sure our UI is in the correct state.
    showDetails(mCurCheckPosition);
    } else {
    // We also highlight in uni-pane just for fun
    getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    getListView().setItemChecked(mCurCheckPosition, true);
    }
    }
     
    @Override
    public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    Toast.makeText(getActivity(), "onSaveInstanceState",
    Toast.LENGTH_LONG).show();
     
    outState.putInt("curChoice", mCurCheckPosition);
    }
     
    // If the user clicks on an item in the list (e.g., Henry V then the
    // onListItemClick() method is called. It calls a helper function in
    // this case.
     
    @Override
    public void onListItemClick(ListView l, View v, int position, long id) {
     
    Toast.makeText(getActivity(),
    "onListItemClick position is" + position, Toast.LENGTH_LONG)
    .show();
     
    showDetails(position);
    }
     
    // Helper function to show the details of a selected item, either by
    // displaying a fragment in-place in the current UI, or starting a whole
    // new activity in which it is displayed.
     
    void showDetails(int index) {
    mCurCheckPosition = index;
     
    // The basic design is mutli-pane (landscape on the phone) allows us
    // to display both fragments (titles and details) with in the same
    // activity; that is FragmentLayout -- one activity with two
    // fragments.
    // Else, it's single-pane (portrait on the phone) and we fire
    // another activity to render the details fragment - two activities
    // each with its own fragment .
    //
    if (mDualPane) {
    // We can display everything in-place with fragments, so update
    // the list to highlight the selected item and show the data.
    // We keep highlighted the current selection
    getListView().setItemChecked(index, true);
     
    // Check what fragment is currently shown, replace if needed.
    DetailsFragment details = (DetailsFragment) getFragmentManager()
    .findFragmentById(R.id.details);
    if (details == null || details.getShownIndex() != index) {
    // Make new fragment to show this selection.
     
    details = DetailsFragment.newInstance(index);
     
    Toast.makeText(getActivity(),
    "showDetails dual-pane: create and relplace fragment",
    Toast.LENGTH_LONG).show();
     
    // Execute a transaction, replacing any existing fragment
    // with this one inside the frame.
    FragmentTransaction ft = getFragmentManager()
    .beginTransaction();
    ft.replace(R.id.details, details);
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
    ft.commit();
    }
     
    } else {
    // Otherwise we need to launch a new activity to display
    // the dialog fragment with selected text.
    // That is: if this is a single-pane (e.g., portrait mode on a
    // phone) then fire DetailsActivity to display the details
    // fragment
     
    // Create an intent for starting the DetailsActivity
    Intent intent = new Intent();
     
    // explicitly set the activity context and class
    // associated with the intent (context, class)
    intent.setClass(getActivity(), DetailsActivity.class);
     
    // pass the current position
    intent.putExtra("index", index);
     
    startActivity(intent);
    }
    }}
    // This is the secondary fragment, displaying the details of a particular// item.
    public static class DetailsFragment extends Fragment {

     

--
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
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[android-developers] Digest for android-developers@googlegroups.com - 6 updates in 4 topics

Comments: (0)

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

    yaturner <thursdaynext@gmail.com> Mar 27 04:21PM -0700  

    Try wrapping both views in a FrameLayout. That should guarantee that they both occupy the same space

     

    Jose_GD <jose.gonzalez.d@gmail.com> Mar 27 06:07AM -0700  

    LOL!
     
    Thanks Kostya, working hard now on improving it!
     
    José
     
    El miércoles, 26 de marzo de 2014 16:44:39 UTC-3, Kostya Vasilyev escribió:

     

    Bradley O'Hearne <brado@bighillsoftware.com> Mar 27 02:32PM -0700  

    Hey Jose,
     
    I feel your pain. I've been an app developer since the beginning of smartphone app development, and have both experienced first-hand and watched others experience the really unfair treatment by people in ratings and reviews, and the unfortunate inability of the associated app market ratings system to basically facilitate consistent accurate and legitimate reviews. Alas, I am just another app developer, and cannot fix the problem for you. But what I can do is the following:
     
    - Let you know that I'm sure you put a lot of hard work into your app development, and would like to have that work and the product recognized and treated accordingly. So just know there's one person out there who appreciates whatever late nights and weekends you put in to make it happen. You SHIPPED PRODUCT. That's more than most big companies do well.
     
    - I'll check out your app and I'll give you a fair rating, provided it isn't expensive. If it isn't free, don't send me any kind of freebie or anything like that — I'm happy to buy and review it. Maybe if a few devs out there help a brother out and perhaps Google straightens out whatever nefarious star-forces are at work, it can straighten out your rating. Just send me the link to the app, I'll check it out.
     
    Keep your chin up, and happy coding.
     
    Cheers,
     
    Brad
     

     

    12169 <ashish.acet@gmail.com> Mar 27 03:38AM -0700  

    Hi,
     
    In General Dual Sim Device Data Roaming option is available at
    Settings/Dual Sim Settings .As per search i donot find any way to open this
    page.Any help?

     

    Yuvi <testandroidos51@gmail.com> Mar 27 02:04AM -0700  

    Hi Rashmi,
     
     
    You have to create your Handler in separate thread.
    Then you can run that thread in your onCreate() of your Service2, like new
    LooperThread();
     
    public Handler mHandler; // Your handler
     
    class LooperThread extends Thread {

     
    public void run() {
    Looper.prepare();
     
    mHandler = new Handler() {
    public void handleMessage(Message msg) {
    // process incoming messages here
    }
    };
     
    Looper.loop();
    }
    }
     
     
    For more info you can look here
    http://developer.android.com/reference/android/os/Looper.html
     
    Regards,
    Yuvi
     
    On Wednesday, February 26, 2014 5:22:11 PM UTC+5:30, Rashmi wrote:
     

     

--
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
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[android-developers] Digest for android-developers@googlegroups.com - 8 updates in 6 topics

Comments: (0)

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

    Abhilash Baddam <abhilash.androiddeveloper@gmail.com> Mar 26 11:18PM +0530  

    any help on this.... :)
     
     
    On Wed, Mar 26, 2014 at 9:04 AM, Abhilash Baddam <

     

    TreKing <trekingapp@gmail.com> Mar 26 09:16PM -0500  

    On Tue, Mar 25, 2014 at 10:34 PM, Abhilash Baddam <
    > machine now in the same code i am making changes in some other machine,
    > after making the changes if i run the app then the map is not getting
    > loaded need to change the map api key it seems.
     
    This is because the different machines have different debug keys which
    require different map keys. However, regardless of your machine, if you
    have your original release key, that should continue to work for your
    release build.
     
     
    > Do we need to create the api key every time if we make changes in
    > different machines?
     
    You need a new key for each unique signing certificate. On different
    machines, the debug certificate will be different, hence you'll need a
    different key.
     
     
    > How can i use the existing key now?
     
    Pull your debug key off the old machine, if you can. Or build in release
    mode when testing your map.
     
    On Wed, Mar 26, 2014 at 12:48 PM, Abhilash Baddam <
    abhilash.androiddeveloper@gmail.com> wrote:
     
    > any help on this.... :)
     
     
    Bro, relax. This is a volunteer group and you posted your question late at
    night U.S. time on a school night. Wait patiently for help and bump your
    thread only after a few days.
     
    -------------------------------------------------------------------------------------------------
    TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
    transit tracking app for Android-powered devices

     

    deepwinter2@winterroot.net Mar 26 05:07PM -0700  

    Did you solve this issue? I have not been able to get searchmanager
    callbacks to work.
     
    On Friday, June 12, 2009 1:56:27 PM UTC-7, Stephen Yu wrote:

     

    Nathan <nathan.d.mellor@gmail.com> Mar 26 01:24PM -0700  

    And get this. Apparently Google Play Support is blaming me.
     
    ==
    "What I suggest is that you contact the developer and ask them when they are
    going to release an update that is compatible with Kit Kat. After they do
    this the app should work as it did before you perform the update."
     
    I got pretty steamed and have been contacting them.

    Someone responded:
    "your target SDK is 17, platform version 4.2. Currently the customer's
    device is running Kit Kat, platform version 4.4.2."
    "For the reasons stated above it looks like the app is not compatible with
    the user's device."
     
    Well, apparently Google Play support doesn't know the difference between
    target SDK and MaxSDK, but they are willing to think that they do. Or maybe
    they do have some information that suggests rolling the targetSDk will fix
    this problem. But there is no such information at the Android developer
    site. Really wish it were that simple.
     
    Nathan

     

    Jose_GD <jose.gonzalez.d@gmail.com> Mar 26 11:28AM -0700  

    Any news regarding this issue?
     
    I don't know if I didn't pay attention before or if it's a brand new
    feature of the Play app. Now you can rate an app immediately after tapping
    Install (or Buy), *before* the install completes! How can you have an
    opinion for an app you actually didn't use at all?
     
    No wonder my app 3 months ago had a 4.4 rate and now has a 4.16 rate. And
    the last update was 4 months ago...
     
    Thanks for any clues
     
    José
    https://play.google.com/store/apps/developer?id=Jos%C3%A9+Gonz%C3%A1lez+D%27Amico
     
     
    El miércoles, 22 de enero de 2014 19:43:29 UTC-3, Nobu Games escribió:

     

    Kostya Vasilyev <kmansoft@gmail.com> Mar 26 11:44PM +0400  

    > feature of the Play app. Now you can rate an app immediately after tapping
    > Install (or Buy), *before* the install completes! How can you have an
    > opinion for an app you actually didn't use at all?
     
    Haven't you heard about Google Mindreader -- part of the latest Play
    Services update?
     
    Sorry, could not resist :)
     
    PS - that's a very nice looking widget.
     
    -- K
     
     

     

    Andrew Mackenzie <andrew@mackenzie-serres.net> Mar 26 11:18AM -0700  

    I think with your current code, getInstance() will return null in your test.
    You might want to check that....
     
    Well, the quickest hackyest thing that works fine and will get you running
    is:
    - add a setter to your service class that overrides the assignment to mBar
    that is done on construction.
    Depending on how you structure you packages for test, you can leave it
    package default scope and not publicly expose it beyond the test code.
     
    If you want to spend more time, then you might want to look at Dagger and
    have it @Inject the Bar into the service when the system Constructs it for
    you, and then you override the Injection during the test with a Test Dagger
    Module that injects the Mock.
     
    Andrew
     
    On Monday, 24 March 2014 05:37:13 UTC+1, Yuvi wrote:

     

    Simon Giddings <mr.s.giddings@gmail.com> Mar 26 08:45AM -0700  

    I am building a layout where text is displayed in a TextView.
    When the user taps on the text, I want to display an EditText widget to
    allow for the text to be modified.
     
    I use a relative layout to ensure have the two widgets in the same position.
    The edit text is declared first and then the the TextView is made to align
    to the top and bottom of the EditText.
     
    However, I have seen that the text displayed in the EditText is offset down
    and to the left.
    I need to ensure that, for the user, the text does not appear to move at
    all when "switching" to the EditText.
     
    Do I need to use padding values to align the text displays ?
    If I do, is this guaranteed to work on all displays ?
     
    Here is the relevant part of my layout :
     
    <RelativeLayout
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_weight="1"
    android:paddingTop="15dp"
    android:paddingLeft="20dp">

    <EditText
    android:id="@+id/etListName"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:visibility="visible"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="List name" />

    <TextView
    android:id="@+id/tvListName"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignTop="@+id/etListName"
    android:layout_alignBottom="@+id/etListName"
    android:layout_alignParentLeft="true"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:visibility="visible"
    android:text="List name" />

    </RelativeLayout>

     

--
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
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[android-developers] Digest for android-developers@googlegroups.com - 8 updates in 4 topics

Comments: (0)

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

    Abhilash Baddam <abhilash.androiddeveloper@gmail.com> Mar 25 11:33PM +0530  

    Hi,
    I have developed an app long time back using google map api v1, there i
    have used mapview. Now i want to make some changes in that but i couldnt be
    able to create map api key for that app now. How can i create the map api
    key for that.
    I know that map api v1 is deprecated but to use map api v2 in my app , i
    have to make so many changes in my app which i do not want.
    Cant i create the map api key for google map v1???? Can anyone suggest me???
     
    Thanks.

     

    TreKing <trekingapp@gmail.com> Mar 25 06:39PM -0500  

    On Tue, Mar 25, 2014 at 1:03 PM, Abhilash Baddam <
     
    > I have developed an app long time back using google map api v1, there i
    > have used mapview. Now i want to make some changes in that but i couldnt be
    > able to create map api key for that app now.
     
    What happened to your existing key?
     
     
    > How can i create the map api key for that.
     
    You can't.
     
     
    > I know that map api v1 is deprecated but to use map api v2 in my app , i
    > have to make so many changes in my app which i do not want.
     
    Yup, it sucks.
     
     
    > Cant i create the map api key for google map v1????
     
    No, you cannot!!!!
     
     
    > Can anyone suggest me???
     
    I suggest you find your old V1 key, remove the map from your app, or
    embrace V2!!!
     
    Good luck.
     
    -------------------------------------------------------------------------------------------------
    TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
    transit tracking app for Android-powered devices

     

    Abhilash Baddam <abhilash.androiddeveloper@gmail.com> Mar 26 09:04AM +0530  

    Hi Treking,
     
    Thanks for the reply.
     
    My existing key is not working. While developing the app, I used different
    machine now in the same code i am making changes in some other machine,
    after making the changes if i run the app then the map is not getting
    loaded need to change the map api key it seems.
    Do we need to create the api key every time if we make changes in different
    machines?
    How can i use the existing key now?
     
     

     

    Jeff Campbell <jeffdcamp@gmail.com> Mar 25 10:56AM -0700  

    The latest version and the Google Play Services (4.3) now adds about 2,500
    more methods (since 4.2)!! (Adding Google Play Services to your project
    will add about 14,000 methods to your app).... seems to be getting worse
    and worse!
     
    On Friday, February 7, 2014 2:14:50 PM UTC-7, Jeff Campbell wrote:

     

    Jags <jagatm@gmail.com> Mar 24 11:07PM -0700  

    Hi All,
     
    I tried to capture an image and send it to server in my app. I did that
    using camera intent. the problem is in my samsung galaxy s4 device the
    image is rotated -90 degree by default. I read around web that it is a
    problem with the samsung devices. But what is the best solution to it ? if
    i rotate the image after capture, it becomes heavy image processing in my
    app. What is the best approach to resolve this ?
     
    in phonegap there is something like correctOrientation = true / false
    what's its counterpart in native code ?
     
    thanks and regards
    jags

     

    Doug Gordon <gordonwd@gmail.com> Mar 25 05:35AM -0700  

    This may not be related to your problem, but I believe that there are
    basically two ways that the orientation of a JPEG photo is determined. One
    is simply by the way the actual data in the file is laid out; for example,
    whether it is stored as 1024x768 or 768x1024. The other determinate is an
    (optional) datum in the file's "metadata" that specifies "camera
    orientation" and indicates the degrees of rotation. So even if a photo's
    data is stored as 1024x768, if the orientation data is "+90", then it is to
    be displayed rotated to the right in 768x1024 format.
     
    The problem that I've found is that not all devices or image
    processing/display software seems to use the metadata and, making things
    worse, may not propagate the data when saving a modified image. So I've had
    photos from my phone that I've had to rotate in image software to make them
    look right on my PC, but then I'll do something like upload them to
    Facebook and they're rotated the wrong way!
     
    I might be wrong about this, but it's what I've concluded after playing
    around with various devices and image processing programs.
     
    On Tuesday, March 25, 2014 2:07:37 AM UTC-4, Jags wrote:

     

    smoogli <roy.ben.hayun@gmail.com> Mar 24 11:55PM -0700  

    I tried again in several ways:
    <permission android:name="android.permission.INTERNET"></permission> within
    the <manifest>: did not block binding to the service
    elsewhere within the <service> tag: did not build.
     
    Although looks strange, so an Android service can require from a 3rd party
    entity only a single permission?
     
    any replies welcomed
     
    cheers!
     
     
    On Sunday, March 9, 2014 4:37:55 PM UTC+2, smoogli wrote:

     

--
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
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

[android-developers] Digest for android-developers@googlegroups.com - 2 updates in 2 topics

Comments: (0)

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

    Paulo Morandi <psmorandi@gmail.com> Mar 24 05:54AM -0700  

    Hello,
     
    Technically the Android Service should support injection by giving you some
    "Dependency Resolver/Container" so you can pass the resolver/container from
    the framework you are working with. But this is not the case, in fact, the
    Android Developer Training don't recommend the use of Dependency Injections
    frameworks (
    http://developer.android.com/training/articles/memory.html#DependencyInjection
    ).
     
    Here we are facing the same problem. I think you could use the Android
    Annotations injection (
    https://github.com/excilys/androidannotations/wiki/Enhance-custom-classes),
    but I don't know how you could use it on unit testing because android
    annotations resolve the dependencies in compile time.
     
    Another suggestion is the old fashion "unit test constructor". I don't know
    if this works, but you could give a try: create a constructor that receives
    all your dependencies (but you still need the default without parameters,
    so that Android could start your service) and instead of the traditional
    ServiceTestCase, just do a new FooService with your dependencies and call
    your doSomeThing method.
     
    Hope this help,
     
    Regards
     
    On Monday, March 24, 2014 1:37:13 AM UTC-3, Yuvi wrote:

     

    sushant sharma <sushantsha@gmail.com> Mar 24 12:06PM +0530  

    This sounds something I need. I will try the same and update the thread.
    Thanks Leonid.
     
     
     
    --
    Sushant Sharma
    *Kala Ka Aadar Ho*
    *Manch ka Satkaar ho*
    *Bharat Mata ki Jai ho*

     

--
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
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.