extending android.app.Application

by WildLuka » Thu, 10 Apr 2008 15:39:03 GMT


Sponsored Links
 Dear All,

can you tell me how to go about extending android.app.Application, as
I need some global data access and what to write in the
AndroidManifest.xml ?

your help will be appreciated

many thanks in advance.

Luka

ps ... is it my impression or android docs just fail to tell you what
you really need to know ...
--~--~---------~--~----~------------~-------~--~----~



Extending android.app.Application

by WildLuka » Fri, 11 Apr 2008 00:33:59 GMT


 Dear All,

can you tell me how to go about extending android.app.Application, as
I need some global data access, and what to write in the
AndroidManifest.xml ?

your help will be appreciated

many thanks in advance.

Luka
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Extending android.app.Application

by SnowDrifter » Fri, 11 Apr 2008 03:23:31 GMT


 I started here:
 http://code.google.com/android/intro/index.html 

download Eclipse and install the android package as instructed in the
documentation above. using Eclipse will help you with setting up
applications and your manifest.

Enjoy!



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



extending android.app.Application

by sacoskun » Fri, 11 Apr 2008 08:38:34 GMT


 Hi Luka,

First of all, you need a class(let's say ClassA) that extends the
Application class.
In the AndroidManifest.xml you need to specify your own extended class
as the application in application tag.

....
<application android:name="ClassA">
....

Hope this helps,
-sarp



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



Extending android.app.Application

by WildLuka » Fri, 11 Apr 2008 12:27:28 GMT


 Not exactly what I was looking for ...




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



Extending android.app.Application

by Agus » Fri, 11 Apr 2008 14:00:47 GMT


 WildLuka,

In the android manifest file, you can see <application .. > tag
now add the attribute
android:name="your_full_classname_which_extends_application"
thats all to it.

Agus.







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



Extending android.app.Application

by trickybit » Fri, 11 Apr 2008 22:11:43 GMT


 I didn't use fully-qualified  classname, I used classname starting
with a 'dot' relative to the manifest package.

That is, in the top level <manifest> tag, the package attribute might
have value "com.jjjjjjj.myapp" and in the <application>  tag, the
android:name attribute might have value ".MyApplication" where the
full classname of your Application extension class would be
com.jjjjjj.myapp.MyApplication.

Fully-qualified probably works just fine, but for some things I was
under the impression that this approach was needed.

 Jim







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



Other Threads

1. Installing Platform Files Without GUI

Hi Everyone,
    I apologize if I'm in the wrong place, but I can't figure out how to get
the platform files for development, without running 'android' and starting
the GUI.  I want to avoid running GUI applications on my dev server, since
it's headless and I don't want to forward X particularly. I can't imagine
that it does anything more than figure out your platform, pull down a
tarball and unpack it, surely this doesn't necessitate a gui, does anyone
know how I can get the platform files without it?

Thanks,
Dan

-- 

2. populate() method in ItemizedOverlay throwing null pointer exception

Getting this error when the populate() method is run in
ItemizedOverlay

09-03 18:44:16.869: WARN/System.err(3475):
java.lang.NullPointerException
09-03 18:44:16.869: WARN/System.err(3475):     at
com.google.android.maps.ItemizedOverlay.populate(ItemizedOverlay.java:
312)
09-03 18:44:16.869: WARN/System.err(3475):     at
test.Test.PointOverlay.addOverlay(PointOverlay.java:49)
09-03 18:44:16.869: WARN/System.err(3475):     at
test.Test.Map.onCreate(Map.java:91)
09-03 18:44:16.877: WARN/System.err(3475):     at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1047)
09-03 18:44:16.877: WARN/System.err(3475):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2627)
09-03 18:44:16.877: WARN/System.err(3475):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2679)
09-03 18:44:16.877: WARN/System.err(3475):     at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
09-03 18:44:16.877: WARN/System.err(3475):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
09-03 18:44:16.877: WARN/System.err(3475):     at
android.os.Handler.dispatchMessage(Handler.java:99)
09-03 18:44:16.877: WARN/System.err(3475):     at
android.os.Looper.loop(Looper.java:123)
09-03 18:44:16.877: WARN/System.err(3475):     at
android.app.ActivityThread.main(ActivityThread.java:4627)
09-03 18:44:16.877: WARN/System.err(3475):     at
java.lang.reflect.Method.invokeNative(Native Method)
09-03 18:44:16.877: WARN/System.err(3475):     at
java.lang.reflect.Method.invoke(Method.java:521)
09-03 18:44:16.877: WARN/System.err(3475):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-03 18:44:16.877: WARN/System.err(3475):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-03 18:44:16.885: WARN/System.err(3475):     at
dalvik.system.NativeStart.main(Native Method)

The process running up to this error is as follows: Map, an Activity,
creates and adds two overlays to its map view inside its onCreate
method. When I first run the application, this works fine. My two
overlays appear on the map as expected. I hit the back button (takes
me to a different activity in the application), and re-enter the map
activity. It works fine again. I go back, return, and then
consistently (tried this at least five times now) crashes on my third
return trip to the map. A few PointOverlay methods are as follows:

        public void addOverlay(OverlayItem overlay)
        {
            mOverlays.add(overlay);
            populate();
        }

        @Override
        protected OverlayItem createItem(int i)
        {
          return mOverlays.get(i);
        }

        @Override
        public int size()
        {
          return mOverlays.size();
        }

mOverlays is an ArrayList of OverlayItem objects.
PointOverlay extends ItemizedOverlay.

If anyone has any theories and needs more info, let me know what you
need to know.

-- 

3. click handler with tabs

4. Supplement Google Audible Navigation Instructions?

5. Increase Old Keystore Validity

6. ADT Level editor additional device configurations

7. Help with Live Wallpaper Settings