[android-developers] Re: Managing Large Graphic Set

2009-09-15 Thread Orion2569

I have taken a look at the google video about game programming for
android, although I haven't had the time to watch it all of the way
through yet, it seems like a great start. A big part of why i'm trying
to do it, the way that i'm trying to do it, is because i'm trying to
prevent the manipulation of the graphics from the client-side of the
application (this is supposed to be a client/server type of game,
although it is still pretty basic). Again, I would like some kind of
package that included these for the most part, so I can do a simple
md5/sha-1 checksum on 1 file, instead of each file, everytime the
client loads. I appreciate all of the feedback thus far, as well.

On Sep 14, 7:56 pm, Carmen Delessio carmendeles...@gmail.com wrote:
 That solves a few problems for me. Thanks.

 I know there is no hard  fast answer, but are there any guidelines for what
 the right amount of data to store in files using a method like this?

 What would be too big?

 Carmen

 On Mon, Sep 14, 2009 at 8:38 PM, Mark Murphy mmur...@commonsware.comwrote:





  Orion2569 wrote:
   I would like to use a single file (like zip) to hold all of
   the files for several reasons. 1., i'm trying to use a file container
   so i can simply update graphic 4.png and then push it into the zip
   file (for example) from a server.

  It would seem to be even easier just to copy 4.png into position on the
  SD card, rather than modifying a ZIP file.

   2., because android sees all image
   files on the sdcard when you open the gallery application.

  Put a leading dot on your directory name (e.g., .MyApp/ rather than
  MyApp/). The media scanner will not scan inside there.

  --
  Mark Murphy (a Commons Guy)
 http://commonsware.com|http://twitter.com/commonsguy

  _Android Programming Tutorials_ Version 1.0 In Print!
--~--~-~--~~~---~--~~
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] Managing Large Graphic Set

2009-09-14 Thread Orion2569

Hello,

I'm writing a game for a computer class that I'm currently taking for
school. The game has a lot of graphics associated with it (mostly
in .png format). There is too much data to simply include it as part
of the 'res'. The way i'm currently doing it, is to store all of the
graphics in a single zip file, in a folder on the SDCard, e.g., /
sdcard/Game/PlayerImages.zip (or whatever). And then i'm using the
ZipInputStream to read from those, then using the BitmapFactory to
decode the stream and then draw them on the canvas. The problem that
I'm having is that this method is terribly slow if I add a lot of
images into the zip file. The best way I have found thus far is to
name the .png files within the zip numerically, then use a for-loop to
jump directly to a specific file, but this is still a very slow way of
doing it. I would like to use a single file (like zip) to hold all of
the files for several reasons. 1., i'm trying to use a file container
so i can simply update graphic 4.png and then push it into the zip
file (for example) from a server. 2., because android sees all image
files on the sdcard when you open the gallery application. 3., easier
to prevent data manipulation by doing an md5/sha-1 checksum on 1 zip
file, rather than every time a file is opened if it weren't in a
container.

If anyone has any advice or suggestions for how to accomplish what I'm
looking for, or can at least point me in the correct direction, I
would greatly appreciate it.

Thanks,
Ryan
--~--~-~--~~~---~--~~
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] BitmapFactory Image from ZipFile

2009-08-09 Thread Orion2569

Ok, basically what i'm attempting to do is place several images into 1
zip file, and then read the images back out of the zip file, and draw
them onto a canvas using BitmapFactory. This is what my code looks
like, but when i debug i only get a source not found error.

Code:
try {

FileInputStream fis = new FileInputStream(/sdcard/Images/
Images.zip);
ZipInputStream zis = new ZipInputStream(fis);
ZipEntry ze = null;

// Until we find their map, or we run out of options
if(zis.getNextEntry()!=null) ze = zis.getNextEntry();



while ((ze.getName() != (Background.png)) 
zis.getNextEntry() != null){
ze = zis.getNextEntry();
}


if (ze.getName() == Background.png){
mBackground = BitmapFactory.decodeStream(zis);
}
else
mBackground = null;




  } catch (FileNotFoundException e) {
e.printStackTrace();
  } catch (IOException e) {
e.printStackTrace();
  }


Zip File Contents:
-Images.zip
--Background.png



I'm not too familiar with the debugging android apps, or what is
causing the file not found. (And the archive is located correctly on
my SD card). Any help would be greatly appreciated.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---