Performance: pre-instantiate activities on app launch? Good practice or not?

by matthias » Wed, 01 Apr 2009 15:52:21 GMT


Sponsored Links
 Thanks for your reply Dianne.

As to profiling, I looked at traceview, but seems to be a bit overly
simplistic to actually profile a whole app. What I understand from the
documentation, what it actually does is measuring the time it takes
for a single method to complete. That's not a terribly useful
information if you want to see the big picture, however (i.e. get
answers to questions such as: how much time does the app spend in
which parts of the code base?).

Are there any plans to make traceview a tad more capable? That would
be great news!

Cheers,
Matthias
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. cant hook onto xml -- quick help?

i am getting null pointer exceptions when i am trying to run this
method.
it gets errors at the title.setText(currenttrack.getTitle()); line
because title was set as null. i dont see what happend, and when i set
content view it ruins the popup things behind it. what can i go about
doing?



public void popuptrack(View v, SeeqPodTrack currenttrack){
                v.setId(R.layout.trackinfo);

                TextView title = (TextView)findViewById(R.id.Title);
                title.setText(currenttrack.getTitle());
                TextView creator = (TextView)findViewById(R.id.Creator);
                creator.setText(currenttrack.getCreator());
                TextView album = (TextView)findViewById(R.id.Album);
                album.setText(currenttrack.getAlbum());
                TextView genre = (TextView)findViewById(R.id.Genre);
                genre.setText(currenttrack.getGenre());
                TextView location = (TextView)findViewById(R.id.Location);
                location.setText(currenttrack.getLocation());


                PopupWindow pw = new
PopupWindow(getViewInflate().inflate(R.layout.trackinfo, null, null));
                pw.setHeight(320);
                pw.setWidth(200);
                pw.setBackground(v.getBackground());
                pw.setFocusable(false);
                pw.show(v);
                pw.update(0, 50, -1, -1);
    }
--~--~---------~--~----~------------~-------~--~----~

2. Programatically query ContentProvider

Hello everyone,

is there a possibility to programmatically query a ContentProvider?
I've successfully managed to get every currently on the device
installed ContentProvider via the PackageManager. This gives me every
Content Provider by it's Base-URI in the form of e.g.
com.google.android.notepad.NotePadProvider.
What I want now is to programmatically access this ContentProvider.
But since I don't know the provided tables (in the case of  a DB based
provider) and the exposed fields, I can't query the provider.
What I would need is to programmatically access the exact CONTENT_URI
and the fields of the ContentProvider. But since this is not strictly
specified and every ContentProvider can do it differently (e.g.
com.google.provider.NotePad) I don't see a chance to programmatically
query a ContentProvider discovered via the PackageManager.
The only idea that comes to my mind is to do it via reflection, but
e.g. the constant name CONTENT_URI is only a suggestion by Android and
can't be taken for granted as the exact URI to a provider table.

So my question is, does anyone have an idea on how I could
programmatically get all the data from a ContentProvider without
knowing it's tables/fields beforehand?

Thx in advance,

Chris
--~--~---------~--~----~------------~-------~--~----~

3. Screen orientation switch and data

4. what does this mean ?

5. AlertDialog that looks like ProgressDialog?

6. Query on upcoming API features

7. Totally Novice to Mobile apps developement