Some questions about ApiDemo.java

by david » Fri, 09 May 2008 14:42:37 GMT


Sponsored Links
 1. Basically the ApiDemo activity just calls itself recursively, is it
counter-intuitive to efficient running on mobile device?

2. The following code in getData():
        PackageManager pm = getPackageManager();
        List<ResolveInfo> list = pm.queryIntentActivities(mainIntent,
0);

        if (null == list)
            return myData;
...
Can it be moved to somewhere for efficency purpose? Since it gets
called again and again but just gets same results.

3. Consider the code in getDate():
        Map<String, Boolean> entries = new HashMap<String, Boolean>();
...
Why use Hashmap? isn't it overskilled?

Again, since it is the demo code provided by Google, I think it is
worthy to study it in detail.
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Video encoding

I'm trying to encode a video file from a series of images using
android.
I am wondering if this is at all possible with the current API's --
all current devices has the ability to encode video ( from the
camera ), but is it possible to use the encoder with user-supplied
images ?

thanks,
Peter

--~--~---------~--~----~------------~-------~--~----~

2. How to set device wide screen orientation

Hi androids,

This is my first message over here and I'm a starting android
developer so please be patient. Here's my case; I'm trying to create a
simple program that sets the device's screen orientation by the press
of a button. It's quite easy to set and change the orientation for the
current activity, but I want to set and keep the setting until the
button is pressed again like when the keyboard is slide out and back
in on a G1 or by the movementsensor.

I started with using the setRequestedOrientation() but I quickly found
that's only for the current activity, as soon is I close the activity
the screen returns to it's original state. I then found that it's
possible to set orientation with updateConfiguration()

Configuration config = new Configuration();
config.orientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
getResources().updateConfiguration(config, getResources
().getDisplayMetrics());

but this doesn't seem to have any effect for what soever.

I've spent hours and hours googling for possible solutions but I'm
completely stuck and the only option I found was to emulate the
keyboard slide out and in, but besides the fact that I wouldn't know
how, that seems a bit of a big solution for what seems to be a simple
task.
I thought this would be easy (and maybe it is), can somebody help me
out or point me in the right direction?

Thanks in advance,
Michel

--~--~---------~--~----~------------~-------~--~----~

3. DataSource

4. Why did binder report transaction failed?

5. Res: What is Mediaplayer.[..] onBufferingUpdate actually telling me?

6. HTTPS connection in Android how to do it?

7. ksoap library on android