A feature of my Android application is to allow users to choose graphical assets from a gallery view. Each asset is physically defined by an individual JSON file on the file system. The application ships with a set of these assets. At present, the scheme is very simple and crude: The application just presents the user with a list of file names of those assets in a simple list for the user to select from.
What I want to achieve is categorisation into 'theme', 'type', and 'name'. Furthermore, I would like to implement sharing of customised and user-created assets through a central server.
I'm considering using a kind of URI scheme for these assets, with the following structure:
[author][theme][type][name]
The objectives of the URI scheme would be to:
- Have a single namespace to identify the assets (the server would regulate the
authorpart of the URI a registration mechanism). (This is important, because users might also share the "canvas" on which they placed the assets. Therefore the app need the ability to locate the assets used within it.) - Facilitate REST requests to the server for sharing operations between users.
- The asset gallery viewer could automatically categorise assets into author, theme, and type using the URI scheme.
- Allow themes and asset names to be in any language. I intend to use %-encoding to support Unicode characters.
The crux of my question is precisely what URI syntax I should use, and how I use it. Specifically:
- What's the 'best' way to assign filenames to the assets? Should I use a kind of reverse domain name notation file name e.g.
joebloggs.mytheme.widgets.awidget, or perhaps do it the Java way and call the fileawidgetand declare a "package"joebloggs.mytheme.widgetsinside the file itself? - It would be nice if the URI could directly translate somehow to request paths when making HTTP REST requests to pull or push assets.
I'd be particularly appreciative of any real examples of use cases that sound similar that I can look at for reference.
Aucun commentaire:
Enregistrer un commentaire