list of array types that can be created in a resource file...

by Richard Schilling » Thu, 30 Apr 2009 02:45:00 GMT

Sponsored Links
 I see in the Android documentation that I can create various resources
resources.html), but the <string-array> resource isn't covered.  Sure,
it's in examples ....

But, what I'm looking for is a list of XML tags that tell me what
kinds of other arrays I can create.  The Android docs are comming up
short in this area.

Or have I just overlooked something?

Can someone point me in the right direction?




Other Threads

1. trying to write to file and failing

hi im just trying to save some text to a file on android and while it
works fine on the emulator "dont crash", when i try it on my phone it
crashes, what am i doing wrong? heres the code:

            File root = Environment.getExternalStorageDirectory();
            if (root.canWrite()){
                 File file = new File(root, "file.txt");
                 FileWriter writer = new FileWriter(file);
                 BufferedWriter out = new BufferedWriter(writer);
                 out.write("some data");
                 showMes("File saved.");
                 showMes("Could not save file.");
        }catch(Exception e){

i do know it crashes on " File root =
Environment.getExternalStorageDirectory(); " i just dont know why.
showMes() is just a function to make toast. thanks for any help.


2. My app crashes upon relaunch

- Windows XP box
- Eclipse with ADT 9.6
- Test Devices: Droid and Eris

I am putting the finishing touches on a new game -- my first Android
app.  The last big problem I am having is as follows.

After launching the app from the home screen, using and exiting,
*relaunching* the app from the home screen generates an exception.
Looking at LogCat shows the following error: "ERROR/dalvikvm-
heap(25501): 1728000-byte external allocation too large for this
process."  Pressing [Force Close] closes the app.  The 3rd attempt to
run is successful.

What I Know:

- The app properly handles the [HOME] button, i.e. disappears and
reappears at the user's discretion.

- The app has two activities: Intro and Game

- The Intro activity has MAIN and LAUNCHER attributes in manifest.  It
does very few allocations but does have a couple screen-sized bitmaps
that are displayed.  When the user is ready to move to the Game
activity, the Game activity is started and the Intro activity is
finished (onDestroy() is called).

- The Game activity has many allocations of all sizes.  I know I am
cruising near the max amount of allocations because I am constantly
refactoring the app to find ways to creatively stay within memory
limits.  The Game activity has a thread that runs for the life of the
activity.  When the user ends the app with the BACK key the app starts
its clean-up.  The thread appears to be properly finishing as does the
activity (onDestroy() is called).  The app's onTerminate() method is
never called (based on my hours of searching for answers, it's seems
this is okay).

- I was having memory limit problems a couple weeks ago and that was
the reason I divided a single activity into two activities.  I was
surprised that this, alone, did not solve my problem.  Within the
Intro Activity (which, as I stated, appears to be finishing properly)
I had explicitly set the only view's background to null since it has a
big bitmap.  This worked but was a surprising solution since I thought
the View object, etc. would all be GC'ed when the activity finished,
so I am uneasy about it as a long-term solution.

- At this point I am suspicious of two things: memory leaks and
improper management of app/activity life cycle.

- Memory Leaks: I have done pretty deep memory leak debugging in the
past in the C++/Windows world.  In the Android/Eclipse world, I am a
novice.  I have gotten as far as getting the Allocation Tracker to
show up in Eclipse.  I have not been successful in getting it to
display allocations for the app.

Improper App/Activity Life Cycle: I *think* I'm doing all the right
things but obviously I am not.  My assumption originally was the the
app's onTerminate() was where I should clean up global items.  Since
it's not being called, I moved that clean-up to Game activity.  I have
tried a variety of Activity attributes (such as "Finish on Task
Launch") with no success.  Admittedly, I am trying these but not with
confidence in my understanding of what the all, exactly, mean.

- The location of the memory allocation is noted in the code snippet
below.  What's odd is that app's onCreate() is only called during the
first launch, not the 2nd.

Thank you for your help.


====== Intro Activity's onCreate() =========

    public void onCreate(Bundle savedInstanceState)
        Log.i("Tom", "IntroActivity.onCreate()");

        setContentView(R.layout.intro);         <------------ Causes

        Log.i("Tom", "m_app = " + m_app);
        m_app = BasketballApp.GetInstance();
        Log.i("Tom", "m_app = " + m_app);

====== Custom LogCat Dump =========

-- 1st Launch
05-03 16:36:46.483: INFO/Tom(25670): app.onCreate()
05-03 16:36:46.491: INFO/Tom(25670):    - Looks like App is starting
05-03 16:36:46.507: INFO/Tom(25670): IntroActivity.onCreate()
05-03 16:36:47.202: INFO/Tom(25670): m_app = null
05-03 16:36:47.202: INFO/Tom(25670): m_app =
05-03 16:36:59.124: INFO/Tom(25670): Activity: onCreate()
05-03 16:36:59.460: INFO/Tom(25670): GameView $
05-03 16:36:59.460: INFO/Tom(25670): BasketballThread $()
05-03 16:37:00.710: INFO/Tom(25670): Activity: onStart()
05-03 16:37:00.710: INFO/Tom(25670): Activity: onResume()
05-03 16:37:00.882: INFO/Tom(25670): IntroActivity.onDestroy()
05-03 16:37:09.616: INFO/Tom(25670): surfaceCreated()
05-03 16:37:09.616: INFO/Tom(25670): startGameThread()
05-03 16:37:09.616: INFO/Tom(25670): freezeGameThread()
05-03 16:37:09.616: INFO/Tom(25670): setSurfaceSize()
05-03 16:37:09.655: INFO/Tom(25670): {start}
05-03 16:37:09.710: INFO/Tom(25670): _setSurfaceSize() end
05-03 16:37:20.147: INFO/Tom(25670): Activity: onPause()
05-03 16:37:20.303: INFO/Tom(25670): surfaceDestroyed()
05-03 16:37:20.311: INFO/Tom(25670): freezeGameThread()
05-03 16:37:20.585: INFO/Tom(25670): Activity: onStop()
05-03 16:37:20.585: INFO/Tom(25670): Activity: onDestroy()
05-03 16:37:20.593: INFO/Tom(25670): stopGameThread()
05-03 16:37:20.616: INFO/Tom(25670): {end}
-- 2nd Launch
05-03 16:37:22.522: INFO/Tom(25670): IntroActivity.onCreate()    <----
notice not preceded by app.onCreate()


3. Something wrong here, didn't expect to be resumed

4. Linkify-ed TextView non-linked text disappears on touch

5. No Phone Signal in Emulator (2.1)

6. catching both click and long click on a ListView

7. Test Kecepatan PUSH MAIL dari 3 Provider pada 3 Handset Berbeda dengan 2 Operating Sytem yang berbeda pula.