Runtime resource files with PlayN - android

Working on a game that would like to allow users to select different character skins using PlayN (targeting Android as first platform). But these character skins will be made available later on (and due to their size, player may not want to download ALL skins). So rather than create a large bundle with all skins, is there a way for PlayN to access different resource files at runtime? We can setup a server backend for players to browse the latest available skins.
Any help/pointer is greatly appreciated.

You can use Assets.getRemoteImage to load images remotely.
There is currently no way to cache the downloaded images, which makes this non-optimal for your purposes, but I'm going to add support for caching the downloaded images which should make it work reasonably well if you use texture atlases and don't have a ton of images to download.
If you do need to download dozens or hundreds of images in one fell swoop, then you'll need to write custom per-backend code to handle that (and you'll have to give up using the HTML backend, because it cannot do things like download a zip file and unpack it into local storage).

Related

I need ways in which I can access images on my rpi-4 for an android app I am making

So I have a directory in my RPI-4 which there are various subfolders each of which contains images related to the folder.
I am making an android app which is basiclly a wallpaper folder and I have no clue how to access those images the only method i have in my mind is converting the images to base 64 then having a postgress database to access it but it seems a hassle to convert all the image and then also maintain and update it(as the app will also have a update feature later).
So i am open to learn new stuff in order to find an effective way to solve this.

Is there any recommended number of files/Images to be stored within Android project?

What is the correct way to store files within Android Project?
All files in local folders? All in webserver? 50/50 ?
The reason I am asking is because my project's size has been increasing a lot due to the number of drawables and I am afraid I should do something about it.
Can this compromise the app performance?
The large app size i.e. apk file size might not compromise your app performance but, will certainly make it slower to install your app. From the user's perspective, if two apps provide same features and have similar performance the size of their apk files will be the deciding factor for them to install your app.
Using web server to save drawables can be an efficient way if your app is a web based app. In case, your app does not require web access or internet access for any other purpose, don't save drawables on the web server.
However, I would suggest you to reduce the size of your drawable files in such a way that their quality is not effected. All this can be achieved by help of tools like Photoshop (I have personally not tried this but know that it is possible).
You can also use nine-patch drawables. These drawable files can stretch themselves along the sides specified without compromising the image's quality. For more info on the same visit following links:
http://developer.android.com/tools/help/draw9patch.html
http://developer.android.com/reference/android/graphics/drawable/NinePatchDrawable.html
Also, make sure that your icons are of specifications as specified in the Material Design Guidelines. Visit the link for more details: https://www.google.com/design/spec/style/icons.html#

ebook formats and mobiles

I have an app for android and iOS. I want to add in app option, which allow user select book from list and read it.
List of available books will be load from server.
Now i wondering which book format to choose. First i'm thinking about pdf, but it has not-flexible reflowing for different screens(books contains sheets and formules). Maybe .epub would be good choice?
ps. is this possible to prevent user copy loaded book files?
Should i load files only in memory(without saving on sd), but how then work with files exceeded ram memory?
have you know any good iOS and android libraries, sdk for reading ebook files?
I am searching for the same SDK options and found this for ePub:
http://skyepub.net/downloads/
There are handfuls of PDF SDKs. Throw a dart at the internet and see what it hits, however, I would like to know which ones have risen to the top (e.g., the top 3).
Still looking for .mobi (Kindle's format).

Add and load images, videos and pdfs from a raw folder or an SDCard Android Tablet design?

Good day, I have a requirement to create a kind of book app with pdfs, images and videos worth up to 10gb and more on a tablet locally. Now there is no intention to sell it on the android market or any other store, its completely in house, so i think issue with apk size has been clarified. What am asking is, where is the best place to put all this contents so that i can readily load them up and use them accordingly?
Should i be using the raw folder and create sub-folders for each images, videos and pdfs?
Should i create folders on an sdcard(assuming there is one in place)? or
Please if you have any other solution or ideas on how to implement this, I would gladly like to hear this. Thanks for your responses in advance.
P.S by the way, since its a tablet specific app, is there any need to have a multi-pane layout fragment or ii can just use all the space. thank you
I suppose you can use a RAW folder, but it would also make the APK size huge from what I understand because all the files in the RAW folder need to be packaged with the application.
From what I've seen in the past, most applications, actually most games, that have lots of extra data will download the additional data on first launch. Basically:
The application launches
It checks whether or not you have all the additional data (Books, pdfs, images)
If not, it starts downloading that data to the SDCARD.
It may not make sense in your situation, but doing it this way gives you more finite control over how much data needs to be downloaded. If function A only requires package A of additional data, then you only need to download package A, you don't need to download everything. Or perhaps you could let the user choose what packages of additional data they want to download, which would also save bandwidth, time and resources.

PDF reading on Android

I have to make an application that should capable of reading PDF documents on Android device. Actually I do not want my app to be dependent on other apps to read the PDF file.
I had gone through the questions that are asked here and at some other places also. They all directly or indirectly using third party app.
Is there any API or something similar is available through which I can implement reading of PDF files directly in my app? How about converting the PDF document to PNG image? But the PDF-PNG method wont let users select the texts.
Any suggestions?
Thanks
There exists an library from Adobe that you can use. Its based on the NDK and you need to do the wrapping all by yourself. Its also extremely expensive, basically nothing for a small firm/single developer but for bigger companies. Afaik the license is not only expensive but also annual based, so you need to pay for it in every year...
There are other libraries, basically open source. Some of them have good performance but a lack of functionality (most of them based on NDK, too). I found only one pure "java" library but the performance was more than worse (loading time 10sec for a page and more).
There are three possibilities you should consider:
Using an external application, so you just need to implement the library of your PDF documents
You write everything by yourself including a pdf reader part
You create a middle "tier" where you convert your PDF into PNGs or JPG (I prefer PNG for better quality). The much better performance comes with a lack of features.
I'm currently developing a complex application like mentioned in 3. but I can't go into details, sorry.
I would definitely recommend the Qoppa stuff on Android.

Categories

Resources