This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#11639 - Android port: add theme downloader activity
Attached to Project:
Rockbox
Opened by Maurus Cuelenaere (mcuelenaere) - Thursday, 23 September 2010, 00:15 GMT+2
Opened by Maurus Cuelenaere (mcuelenaere) - Thursday, 23 September 2010, 00:15 GMT+2
|
DetailsThis patch introduces 2 new activities, one which lists available themes for a specified target and another which lists more details and the option to install the specific theme. Currently this is more a proof-of-concept, as the communication with the theme server is handled by the same API RBUtil uses, which isn't perfect for the intended usage (e.g. offers no possibility to filter by screen size, only uses INI as output format, ..).
(this also includes some minor unrelated changes to the main Rockbox extraction functionality which won't be in the final patch) TODO: - make translatable - better UI - uninstall/update functionality - show only themes fit for the displays' resolution - use different protocol to communicate with theme server to get rid of iniparser dependency (XML, JSON, .. ?) |
This task depends upon
You just need to give it the correct target name and it will list only themes for this target. Ofcourse the themesite then also needs to have the correct android targets set up.
And what is the problem with the INI format ? Its very easy to parse and to create on the themesite. No need for complex xmls.
The INI format isn't a problem per se, it just requires an extra dependency in Java (AFAIK) compared to e.g. XML or JSON, for which there is support in the framework.
Also, I'm not sure about the license of the IniParser class I'm currently using, but that's not really relevant.
Sometime ago, rbutil did send the screen resolution to the themesite, but this was changed. Probably because screen size isnt the only thing which defines if a theme works on a target or not.
Currently the themesite decides based on the results of checkwps if a theme works on a specific target.
With the ini format its the other way round for rbutil. XML would need a extra dependency and the Ini format parser is built-into Qt.
And google just told me, JAVA can handle ini file nativly as it is the same format as .properties files. Take a look at this Webpage: http://www.java-tips.org/java-se-tips/java.util/how-to-use-an-ini-file.html
But we could ofcourse create another API on the themesite only for the android targets. Feel free to hack the themesite, its in svn :-)
And I didn't know about that API, I'll take a look at it.
I think only sending the screen resolution to the theme site, which then looks up all touchscreen-compatible themes with that resolution, should be doable.
Also, smartphones are getting more and more close to computers feature-wise; they're perfectly capable of downloading a file from the internet and unzipping it.
I, for example, wouldn't want to use RButil for just installing themes, something which could be done perfectly on the phone itself (hence the patch :) ).
Perhaps it could work better as a separate app?
2) this isn't "bloating" main Rockbox, as it only touches the Java parts (contrary to my dynamic screen size patch) thus unaffecting other targets; this would merely mean an increase in apk size (and possibly RAM size)
3) making this a separate app would require having the .rockbox directory writeable to other apps, and from a security POV only apps allowed by Rockbox should access these. After a quick google, I couldn't find a way to selectively allow acces (only an all-or-nothing solution exists, by chmod'ing the files world read-/writeable).
I guess it's up to the (developer) community to decide whether we'd want this in or not. In any way, I'll try to get this cleaned up and committable this week.
Currently it's an item in the options menu in the main Rockbox activity, which launches the ThemeListActivity activity.
We can surely discuss this and possibly change things, I'm just noting that I'm not aware of any agreement.
* Got rid of IniParser dependency and replaced the themes backend on the site with a new one (using JSON)
* Moved the app to a separate project (whether this needs to be in Rockbox SVN is debatable, but I'd like it)
TODO:
* Implement theme scanning and Theme Management Activity
* Improve/Fix image loading in DrawableManager/ThemeListActivity
* Implement JsonReader which adds parsed themes from the raw JSON text on-the-fly to the list (optional)
Whether Rockbox should detect the app and offer a way to launch this, I personally don't see a need for it and thus wouldn't use it. Feel free to implement it though :)