Originally Posted by jzero88
I was wondering how hard it would be to create a simple application that would connect to a server or website checking for updates. I plan on loading font .apk's on the server or website, and would like a application to periodically check for updates or manually check for updates, be able to preview the font, and then download the .apk if wanted. How hard would it be to create such an application?
Well, this depends on how you approach it, but I think the easiest way to do this would be to create a feed using XML. So if you were doing your font updater, you would load a file like this:
<Font name = "Font1" example = "http://www.myfontsite.com/FontExamples/Font1.png" location = ""http://www.myfontsite.com/Fonts/Font1.apk"\>
<Font name = "Font2" example = "http://www.myfontsite.com/FontExamples/Font2.png" location = "http://www.myfontsite.com/Fonts/Font2.apk"\>
The problem with this is that you will have to maintain this XML file, making sure its always up-to-date(Easily manageable with some simple scripts).
If you aren't willing to do this, you could go down the road that is wrongly mislabeled as "The Easy Way" and hard-code the locations of all your APK's and all of your example images, but I would only do this if you were planning on dumping all the APK's and images in the same place(For example, if all your APK's were here: http://www.myfontsite.com/Fonts/
). You would request the directory information from the server and parse that into your list of font APK's and correspond them with their example images(probably by naming them the same; i.e. Font1.apk and Font1.png).
If you decide to use the first option, you could do a bunch of cool things with the organization, like break things into categories and apply taggings and it would only require one request to the server per update. If you go with the second method, organization is guaranteed to be a mess if you try anything large scale, and adds a layer of complexity if you try to break things into folders and categories. This would require a ping per folder you have to check, which can have a high complexity factor if you have a lot of folders.
I just want to point out that even though this is directly related to development, this is a type of question that belongs in the General section(Questions ALWAYS belong in General). I'm sure a Mod will come around, scold you, then move the thread.
Anyway, I do hope this helps,
Edit: Having a bit of problems getting the XML looking correct. Sorry if it looks ugly :S
Phone: Sammy Vibrant
ROM: Vibrant 5
Kernal: VooDoo beta4 1.2OC
Recovery Img: Clockwork
SD: Class 4 8GB SDHC