wood burning stoves 2.0*
The moose likes iOS and the fly likes iPhone application (game development) and facing problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Mobile » iOS
Bookmark "iPhone application (game development) and facing problems" Watch "iPhone application (game development) and facing problems" New topic
Author

iPhone application (game development) and facing problems

Khawar Rizwi
Greenhorn

Joined: Oct 09, 2009
Posts: 1
Hi guys,
I am working on an iPhone application (game) and facing problems while retrieving images from file-system.
The scenario of my application is such that an Administrator uploads many images for different levels of game through a web-based admin panel. The images are saved on file system. The related information of images are saved in the database, including the level_id, image_path, image_name, image_id, etc. The admin panel is developed on PHP and MySQL.
To use the database fields on iPhone, I have made the XML of complete database. In the XML I am reading the images using a PHP function ‘file_get_contents’. And encode the images using another PHP function ‘base64_encode’, so that the images do not destroy the XML. I am also getting this XML successfully on iPhone level.
The problem starts when I try to read the ‘image field’ of XML on iPhone. I can read all fields of XML except the image field because it is encoded in 'base64_encode'
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17258
    
    6

Well that is interesting, so you are saying that the xml has the binary information of image?

Not that my approach is the best, but what I would have done is put the location/url of the image on the server and pass that in the xml instead of the image, then create a UIImage fromUrl, and that will download the image and now you can display it.

The XML parsing in iPhone development is a bit well off in my mind. There are other libraries out there that I feel are better then the built in iPhone XMLParser. With the built in you have to read the xml event based, and I also found that indenting the xml causes tab characters to appear when you read the data that just shouldn't be there.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
Don't get me started about those stupid light bulbs.
 
subject: iPhone application (game development) and facing problems