[android-developers] Application Resources on SDCARD on install!! MUST HAVE, GOOGLE DO SOMETHING!!

2009-06-15 Thread TjerkW

Reset the title of this post,..
You really ruined this post though

On 14 jun, 15:02, javaumesh-andr...@yahoo.co.in wrote:
 Hi all

 I have a an activity which has an image view to display animation. and I'm 
 reading resources from res/anim which is working absolutely fine.  But what 
 I'm trying is to specify the frames at run time instead of hard coding at the 
 res/anim/file.xml  any idea. ?

 Following works fine.

    public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);

         setContentView(R.layout.main);
         mImageView = (ImageView)this.findViewById(R.id.AdImageView);
         mImageView.setImageResource(R.anim.adlist);
         adDisplay = (AnimationDrawable)mImageView.getDrawable();
               }

     @Override
     public void onWindowFocusChanged(boolean hasFocus) {
         super.onWindowFocusChanged(hasFocus);
         if(hasFocus== true){
             adDisplay.start();
          }

 and the  adlist.xml is :

 ?xml version=1.0 encoding=UTF-8?

     item android:drawable=@drawable/ad_01 android:duration=500 /
     item android:drawable=@drawable/ad_02 android:duration=500 /
 /animation-list

 But what I wan't is I wan't to create the AnimationDrawable object at runtime 
 not from the xml source,as my requirement is no of frames and *.png files may 
 change at the runtime.

 I tried the following it I'm unable to get the expected result.

 @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
         mImageView = (ImageView)this.findViewById(R.id.AdImageView);
         adDisplay = new AnimationDrawable();
         
 adDisplay.addFrame(Drawable.createFromPath(/data/data/com.example.ad/files 
 /ad_01.png),500 );
         
 adDisplay.addFrame(Drawable.createFromPath(/data/data/com.example.ad/files 
 /ad_02.png),500 );
         mImageView.setImageDrawable(adDisplay);

               }

 Any thing I'm missing in the implementation ?

       Own a website.Get an unlimited package.Pay next to nothing.*Go 
 tohttp://in.business.yahoo.com/
--~--~-~--~~~---~--~~
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-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Application Resources on SDCARD on install!! MUST HAVE, GOOGLE DO SOMETHING!!

2009-06-14 Thread TjerkW

A lot of developers and this problem:
All resources in an APK are stored in the memory of the phone,
it is impossible to force some resources to be saved on the sdcard.

For example, check this use-case:
I am creating a game with multiple levels a lot of sounds, menumusic
and sprites.
The size unpacked is now 6MB and the game is not even finished
Users are already complaining:
http://www.cyrket.com/package/com.tjerk.spacewars


The only current solution is to download the data after installation
on the sdcard and load the data from the sd card (requires your own
data handling code, the convenience R class cannot be used).
This solution is a no-go for a lot of developers because they simply
donot have a server. The users may also find it weird that they have
to install stuff after they installed the app.

Another solution is to have a linux partition on your sdcard, but this
requires a rooted phone and is only for advanced users.

I know they are a lot of issues with installing part of the app on the
sdcard (piracy etc). However if you only install application data on
the sdcard, then there would be no problem. I suggest to create a
.appname directory for each application that requires to save
resources on the sdcard. Window users will not see that directory. If
they delete the directory and restart the app they should get an
alertbox that forces them to reinstall (or remove) the app.

Seriouzly google, you have to add a feature that solves this problem,
the android platform is a no-go for big games. And users can install a
limited number of apps.

What i want to now: Is this going to be implemented in the future?
Or should i implemented the download-from-server solution. If you
are going to implemented it in the next release than i will not waste
time on implementing the download-from-server solution.

Links to other posts of developers that have the same problem:
http://groups.google.com/group/android-developers/browse_thread/thread/9ab3c62274aff2a1/e79c251bdf60ed97?lnk=gstq=application+size#e79c251bdf60ed97
http://groups.google.com/group/android-developers/browse_thread/thread/ca9e824d8451871a/8ffc708d4d87a9a2?lnk=gstq=application+size#8ffc708d4d87a9a2
http://groups.google.com/group/android-developers/browse_thread/thread/8251f0d6ca7f7ecb/311b4ff59bf8dab7?lnk=gstq=resources+on+sdcard#311b4ff59bf8dab7
http://groups.google.com/group/android-developers/browse_thread/thread/381e652ae1b3693a/2f9ffd68ad98ae57?lnk=gstq=resources+on+sdcard#2f9ffd68ad98ae57
--~--~-~--~~~---~--~~
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-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---