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

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

    Jake Colman <colman@ppllc.com> Dec 31 03:30PM -0500  

    I have written code to select at runtime whether my widget should use a
    background PNG image or just select a background color in place of the
    image. This code works fine but is not esthetically pleasing. The
    problem is that when I set just the background color in lieu of the
    image the entire grid space occupied by the widget is colored and it
    just looks bad.
     
    My next idea was to specify a different background that specifies a
    <shape> resource instead of the PNG image. This code works fine too.
    At runtime I select one of two values for setBackgroundResource and I
    can see either the PNG image or the shaped colored background. This
    shaped colored background has margins and rounded corners so it looks
    better than just coloring the background.
     
    Here is my question: Is there a way to specify the color of the shaped
    background at runtime? I can call RemoteView.setInt with
    setBackgroundResource to set the shaped background but how can I set the
    resource's background color?
     
    --
    Jake Colman -- Android Tinkerer

     

    Jake Colman <colman@ppllc.com> Dec 31 04:44PM -0500  

    I don't think it helps to get access to the drawable resource and use
    setColorFilter to set its background color since I don't see a way to
    set the modified drawable resource as the background resource for the
    view.
     
    Am I missing something obvious? I did google before posting but that
    doesn't mean I didn't miss it.
     
    >>>>> "Jake" == Jake Colman <colman@ppllc.com> writes:
     
    Jake> I have written code to select at runtime whether my widget
    Jake> should use a background PNG image or just select a background
    Jake> color in place of the image. This code works fine but is not
    Jake> esthetically pleasing. The problem is that when I set just the
    Jake> background color in lieu of the image the entire grid space
    Jake> occupied by the widget is colored and it just looks bad.
     
    Jake> My next idea was to specify a different background that
    Jake> specifies a <shape> resource instead of the PNG image. This
    Jake> code works fine too. At runtime I select one of two values for
    Jake> setBackgroundResource and I can see either the PNG image or the
    Jake> shaped colored background. This shaped colored background has
    Jake> margins and rounded corners so it looks better than just
    Jake> coloring the background.
     
    Jake> Here is my question: Is there a way to specify the color of the
    Jake> shaped background at runtime? I can call RemoteView.setInt
    Jake> with setBackgroundResource to set the shaped background but how
    Jake> can I set the resource's background color?
     
    Jake> --
    Jake> Jake Colman -- Android Tinkerer
     
    Jake> --
    Jake> You received this message because you are subscribed to the Google
    Jake> Groups "Android Developers" group.
    Jake> To post to this group, send email to android-developers@googlegroups.com
    Jake> To unsubscribe from this group, send email to
    Jake> android-developers+unsubscribe@googlegroups.com
    Jake> For more options, visit this group at
    Jake> http://groups.google.com/group/android-developers?hl=en
     
    --
    Jake Colman -- Android Tinkerer

     

    monty <mca.himanshusharma@gmail.com> Dec 30 10:35PM -0800  

    Hello,
     
    Is there any way to choose one particular theme from list of theme's at run
    time and apply it to entire activities in an application.
     
    I want to show a dialog fragment with radio buttons (with theme names)
    .User will select a particular theme and that theme will be applied to the
    activities.
     
    Dialog fragment is available with me.
     
    Thanks

     

    TreKing <trekingapp@gmail.com> Dec 31 03:29PM -0600  


    > Is there any way to choose one particular theme from list of theme's at
    > run time and apply it to entire activities in an application.
     
     
    Have you done any research on this topic yourself yet? A quick Google
    search shows many Stack Overflow questions and answers on this topic.
     
    -------------------------------------------------------------------------------------------------
    TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
    transit tracking app for Android-powered devices

     

    sree android <android.sreenivas@gmail.com> Dec 31 12:19PM +0530  

    i gave two single dimensional arrays
     
    one array
    prioritynamearray=alistpriorityname.toArray(new
    String[alistpriorityname.size()]);
     
    two array
    taskvaluesarray=taskvaluesarraylist.toArray(new
    String[taskvaluesarraylist.size()]);
     
    The above code i take two ArrayList and convert two single dimensional
    arrays,
    now i need these two seperate arrays as two dimensional array.
    how please convert it and give solution,
     
    thanks in advance.

     

    TreKing <trekingapp@gmail.com> Dec 31 03:27PM -0600  

    On Mon, Dec 31, 2012 at 12:49 AM, sree android
     
    > how please convert it and give solution,
     
    This is not "urgent", nor does it have anything to do with Android
    development.
     
    -------------------------------------------------------------------------------------------------
    TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
    transit tracking app for Android-powered devices

     

    Giuseppe <porcelli.giuseppe@gmail.com> Dec 30 10:42PM -0800  

    Sorry for my English, I will try to write better.
     
    Attached you will find the dump file of alarms on my device, you will see
    that there is no sign of any PendingIntent that have Backup_Email_Receiver
    as class.
     
    I have uninstalled the app, restarted the device, the function is still
    working and every minute sending an email.
     
    Any suggestion is appreciate.

     

    TreKing <trekingapp@gmail.com> Dec 31 03:25PM -0600  


    > I have uninstalled the app, restarted the device, the function is still
    > working and every minute sending an email.
     
     
    Is there anything in the logs when the alarms go off?
     
    -------------------------------------------------------------------------------------------------
    TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
    transit tracking app for Android-powered devices

     

    Evan Ruff <evan.ruff@hendersonsawmill.com> Dec 31 09:49AM -0500  

    Guys,
     
    Thanks so much for your suggestions. I had tried all of the notify* and
    invalidate* methods on the adapter and list to no avail. The easiest
    solution for me was removing the swapCursor( null ) call. After doing this,
    the "orphaned" views no longer persist and everything is working as
    expected.
     
    Thanks guys!
     
    E
     
     

     

    "Nelson André" <nelson.dias.andre@gmail.com> Dec 31 04:32AM -0800  

    Hello all,
     
    I have a JSON list that I retrive from one website I have that gives me the
    following fields:
     
     
    - Name
    - Latitude
    - Longitude
     
    This list has around 200 items.
     
    I want to order the list by distance to my current location, closer
    locations on top.
     
    How may I do this calculation and ordering?
     
    Many Thanks
     
    Nelson

     

    Spiral123 <cumisnic@gmail.com> Dec 31 05:15AM -0800  

    If you mean straight line distance and if the locations are reasonably
    close and/or reasonably well distributed then just do a straightforward
    trig calculation.
     
    If you want more accuracy use a great circle distance calculation (just
    Google it). Assuming you just need a ranking rather than accurate
    distance I suspect this would be overkill in most real-world situations.
     
    If you had thousands of locations to sort rather than just 200 I would do
    the simple trig calc, then sort into distance order and then walk the list
    to see if the distance/separation of adjacent location pairs was within a
    threshold and do the the gc calc to determine the closest.
     
     
     
    On Monday, December 31, 2012 7:32:18 AM UTC-5, Nelson André wrote:

     

    lbendlin <lutz@bendlin.us> Dec 31 06:17AM -0800  

    If the locations are roughly in the same geographical area then you can use
    a corrective factor for the longitude difference. The latitude is always
    the same distance per degree but the longitude distance per degree depends
    on the latitude (biggest at the equator,zero at the poles). For a latitude
    of 52 degrees the factor would be around 0.63 etc.
     
    On Monday, December 31, 2012 7:32:18 AM UTC-5, Nelson André wrote:

     

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

    > I'm specifically trying to first get the
    > ICS AOSP launcher to install on any ICS phone, and then modify it with some
    > features.
     
    You are welcome to copy the source code out of AOSP, import it into an
    Android SDK project, and hack away to get rid of things that do not
    compile anymore. This may take some time.
     
    > I don't
    > necessarily have to use Eclipse, I'm fine with "make Launcher2".
     
    That is not how you build an SDK project from the command line.
     
    --
    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 Android Development_ Version 4.4 Available!

     

    Dev Guy <devguy.ca@gmail.com> Dec 31 06:18AM -0500  

    Carlos thanks, that's what I did and got things working!
     
     
    On Sun, Dec 30, 2012 at 6:24 AM, Carlos A. M. dos Santos <
     
    --
    Kind Regards,
    Rajinder Yadav
     
    SafetyNet Test Driven Development
    http://safetynet.devmentor.org

     

    sebouh00 <sebouh00@gmail.com> Dec 30 11:26PM -0800  

    Sorry, but you're just repeating what Mark said. It's not helpful.
     
    I am not looking for a solution with GPS. My research shows GPS is bad at
    altitude calculations. And I'm sure it uses more power to get an altitude
    because it requires time and outdoors to get a lock, but I have no tests to
    show that.
     
    I asked where I can get real-time sea-level pressure data. I didn't get an
    answer.
     
     
    On Monday, December 31, 2012 1:45:46 AM UTC+3, Lew wrote:

     

    Ifor <ifor@blueyonder.co.uk> Dec 31 01:03AM -0800  

    The method I use for calibrating the barrometric altitude functionality in
    my biking app is to use the gps to get a location I then use Googles Elervation
    API <https://developers.google.com/maps/documentation/elevation/> to get an
    altitude for this location and adjust my reference pressure to get the
    barometric based altitude to match. Haveing done this the relative
    altitude reading during a bike ride tend to be good but if the weather is
    changing a lot you can easaly be +-50m by the end of of a few hours riding.

    Aviation services should have the reference pressure for vaious airfields
    airfields avalable. I would investigate the various weather service api to
    see what is avalable but I think your going to strugle with what you are
    trying to achieve the weather is just too big a variable over significant
    time periods.

    Ifor

     
    On Monday, 31 December 2012 07:26:44 UTC, sebouh00 wrote:
     

     

    Steve Mills <sdemills@gmail.com> Dec 31 01:06AM -0800  

    As a pilot I can tell you that we get a MSL (Mean Sea Level) pressure reading and key that into the altimeter which compares it with current pressure and gives altitude to +50ft/-75ft accuracy.
     
    The MSL is provided by the local airport, is adjusted to ensure any regional error puts us higher than any obstacles, and it varies so the airport will alert us if and when it changes.
     
    Above what's known as the Transitional Layer we are high enough to avoid all ground obstacles to we use standard pressure of 1013.25 mb so that aircraft's altitude is computed relative to each other.
     
    We do heed GPS altitude warnings that we're about to bust airspace but not for accurate altitude measurement.
     
    Hope that helps.
     
    Cheers
    Steve

     

    sebouh00 <sebouh00@gmail.com> Dec 31 01:21AM -0800  

    Thanks guys. I now understand more.
     
    I will have to do some more testing with this information in mind, but from
    what I've understood, achieving the day long accuracy I'm looking for will
    require GPS and frequent base reference updates.

     

    Lew <lewbloch@gmail.com> Dec 31 02:35AM -0800  

    sebouh00 wrote:
     
    > Sorry, but you're just repeating what Mark said. It's not helpful.
     
    >> I repeated it because you clearly did not assimilate it. I also asked
    questions,
    which you chose not to answer.
     
    "It's not helpful" means "I have decided to reject what you say". There's
    nothing
    wrong with the advice /per se/.
     
    But please, no more disingenuous apologies.
     
    --
    Lew

     

    NimeshChanchani <nimeshchanchani@gmail.com> Dec 31 02:32AM -0800  

    sorted.... Stupid path error!
     
     
     
    On Friday, 28 December 2012 16:57:14 UTC+5:30, NimeshChanchani wrote:

     

    monty <mca.himanshusharma@gmail.com> Dec 30 10:38PM -0800  

    use this setRetainInstance(true) in that fragment to which you want to save
    state. within onCreate();
     
    On Saturday, December 29, 2012 1:38:01 PM UTC+5:30, Dmitriy F wrote:

     

    monty <mca.himanshusharma@gmail.com> Dec 30 10:40PM -0800  

    On Saturday, December 29, 2012 1:38:01 PM UTC+5:30, Dmitriy F wrote:

     

    Dmitriy F <midnight.88s@gmail.com> Dec 31 12:41AM -0800  

    In vain - it doesn't work either way. I've made an app to test on - could
    you look into it please ? Full project's in the attachment
     
    public class MainActivity extends FragmentActivity {
     
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
     
    findViewById(R.id.show_the_second_btn).setOnClickListener(
    new OnClickListener() {
    @Override
    public void onClick(View v) {
    ((TextView)findViewById(R.id.textView1)).setTextColor(getResources().getColor(R.color.red));
    replaceCurrentFragment();
    }
    });
     
    replaceCurrentFragment();
    }
     
    private void replaceCurrentFragment() {
    FragmentManager fragmentManager = getSupportFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager
    .beginTransaction();
     
    fragmentTransaction.replace(R.id.fragment_holder, new TestFragment());
    fragmentTransaction.addToBackStack(null);
    fragmentTransaction.commit();
    }
     
    public static class TestFragment extends Fragment {
     
    final static String TAG = "TestFragment";
    final static String STATE_KEY = "k";
     
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
    Bundle savedInstanceState) {
    inspectInstanceState(savedInstanceState);
    return inflater.inflate(R.layout.fragment_test, null);
    }
     
    @Override
    public void onCreate(Bundle savedInstanceState) {
    setRetainInstance(true);
    super.onCreate(savedInstanceState);
    inspectInstanceState(savedInstanceState);
    }
     
    @Override
    public void onSaveInstanceState(Bundle outState) {
    Log.d(TAG, "onSaveInstanceState");
    outState.putString(STATE_KEY, "GG");
    super.onSaveInstanceState(outState);
    }
     
    private void inspectInstanceState(Bundle b) {
    if (b != null && b.containsKey(STATE_KEY))
    Log.d(TAG, "inspectRestoredState key:" + b.getString(STATE_KEY));
    }
    }
     
    понедельник, 31 декабря 2012 г., 10:38:02 UTC+4 пользователь monty написал:

     

    AndroidCompile <androidcompile@gmail.com> Dec 30 11:41PM -0800  

    How can I save the bitmap programatically in a 2 color palette png? Is that
    possible?
     
    On Sunday, December 30, 2012 5:26:42 PM UTC+2, Nobu Games wrote:

     

    Zsolt Vasvari <zvasvari@gmail.com> Dec 30 10:24PM -0800  

    What does "language not supported" means? Are you saying you translated
    your app to Afrikaans but it still shows up in English? Or you have some
    other issue?
     
     
     
    On Monday, December 31, 2012 2:37:42 AM UTC+8, Adam Ratana wrote:

     

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