Skobbler Android SDK: How to add more language files - android

I am trying to use a different audio advice language for navigation, however when I set the SKAdvisorSettings to use a new language (en_us) it said it could not find the file. After some research I found this link saying I needed to add the sound files to the .zip file:
http://forum.skobbler.com/showthread.php/7250-Language-files-for-2-5-0-and-2-5-1
However when I unzip, add the file, and zip again (using Mac, right click, compress), the map fails to initialize and the only error shown is E/SKPrepareMapTextureThread: Shaders or Common files not found
Maybe I do not know how to add files to a .zip without otherwise affecting it, or I am missing how I am supposed to add the sound files to the project completely.
tl;dr: I want to be able to add more sound files to the navigation advice.
Thanks

After you have added the language files, you have to create a new zip by selecting all files inside the SKMaps folder, and renamed it from Archive.zip to SKMaps.zip and move it the assets folder replacing the old SKMaps.zip.

Related

Cordova/Phonegap - Where do I put a data file I want to read?

I've been driving myself crazy trying to find the answer to a seemingly easy question.
I am trying to create my first app using Cordova. I want to bundle a text file with my app that can be read when the app starts up.
Where do I put this file?
dataDirectory seems like a good place, but where is it? Documentation says /data/data/<app-id>/files but where are those data directories? Do I create them?
Update 1: Ok, I think I've figured out that dataDirectory should be pretty much just where the path says it should be, at the root of the file system. But the directory doesn't appear to be created automatically and I don't know how to package a file - a JSON file, for instance - and place it in that directory.
Essentially you do not need to create these directories. Those are created once your app is installed by the Android itself.
A typical way to get this done would be that you could first off add those files in your app's assets directory and then at runtime you can copy those file wherever you want.
There is a repository on Githup which provide a similar functionality.

Unity Android patch.obb file creation and use

We are currently working on a Unity Android project that has to have localised mp4 streaming Videos. In order to achieve this I was hoping to put the video files in an expansion obb file, then we can have the same apk and submit it with different obb files according to language.
Unfortunately our application without the videos is still over 50Mb so we need to use the first "main.1.name.obb" for the application.
However we are allowed to also submit a second obb under the name "patch.1.name.obb". However I am having trouble making this and using it. Has anyone tried this with unity before?
The application builds and runs with the first obb file absolutely fine (i.e. the game works without videos) the problem is just in the patch obb creation.
I have tried to create the obb by using a linux zip command with 0% compression then renaming it to a .obb file with no luck. (e.g. patch.1.packname.zip to patch.1.packname.obb)
I have tried to create the obb using jobb tool, and it adds the videos fine but still in game they are not found/played.
The videos are definitely in an "assets" folder inside the obb files made (where I believe streaming assets have to be)
I have fudged the streaming Assets Path ( Application.streamingAssetsPath ) to replace "main" with "patch" and have seen through logcat that it is indeed trying to get the videos from the patch obb file.
(e.g. "jar:file:///[storagelocation]/Android/obb/packname/patch.1.packname.obb!/vid01.mp4 )
Our version code in the AndroidManifest.xml if definitely 1.
Can anyone suggest anything else to try or point out an clear errors I am making in trying to do this?
Let me know any more information you may need to help as well and thanks in advance.
I haven't worked with Unity before, but from my experience I can point out a few things I have found from working with '.obb' files:
Simply renaming the '.zip' file to a '.obb' file will not work. You will need to make a folder named '.obb'. Then add all the needed resource files to this folder and then zip this folder, using 0% compression of course. Make sure that the zipped file contains only the resource files in the root and not a sub folder (the folder you made previously). Now you have a zip file named '.obb.zip'. At this point you can rename the file to '.obb'. Of course, the files may be in a sub folder inside the obb file (the assets folder in your case), but I am not sure about the consequences of this.
In regards to the statement you made concerning the files that are not found after using the jobb tool, this is most likely due to a miss-spelling somewhere or in one of my cases, forgetting to rename the package after copying it from a previous app. I know this seems foolish and maybe insulting (in which case I deeply apologize), but it happens.
This answer is based on my personal experience and may be slightly off center, but here are some links I used:
http://developer.android.com/google/play/expansion-files.html
http://developer.android.com/google/play/publishing/multiple-apks.html
http://developer.android.com/tools/help/jobb.html

Is there a way to add such folder in Android project that do no get compiled up to **apk**

I was looking for a way to add some such folder in my Android Project that do no get compiled up to my apk file.
Why I need it :-
We need to maintain proper documentation for project (that actually
everybody needs to ;) nothing new),
but I find it very irritating to look out for that documentation
folder again and again.
.
I am open for any way i can make dcocumentain folder easily one
click accessible (I am already doing it thru taskbar sortcut. ) But
I want it to get the ease of version control thru Eclipse likewise we
do it for our project
IDE :- Eclipse
I got a way myself :-
I had an idea that if I create a folder in my application project with
some anonymous name that actually android has not listed in its
directories ("I am talking about the default one like "res", "src",
"anim"......)
Then either it should "raise an error" or should "ignore" it while compiling to form apk file
luckily it ignores any such folder. now i can put all the documentation in my project.
NOTE:-
My answer empirically driven
I had tested it by creating a "Docs" folder and then copied 1 GB of
random data (includes almost all type of files we came across from
multimedia to zipped ones).
Then I build the apk and the size of the apk was in-effective of all
this..
but when i copied the same data to assets it was showing a huge change
in size of my apk file..
Consider using Javadoc in addition or, if possible, instead of any other documentation.

Data in XML: where to place it

I am trying to design a new Android application.
For that application I will have an XML file that will be located somewhere on the server. This file will be generated from the mySQL DB.
For now (developmental phase) I got a simple and small XML file that I need to put in the Android Eclipse project in order to read it and present the data on the phone.
I just tried to put this file in res/values, but compiler gives me an error: "Invalid start tag".
Looking through the stackoverflow and google I see a lot of different answers and google even give me an answer of how to parse xml file on Android. ;-)
So is there a "standard" place where such XML file goes in Android Eclipse project? Think about it as the data that is read from the DB.
Some answers are to place it in the res/xml folder. I just made a brand new Android project and I don't see such folder in it. Do I create one? Shouldn't it be done automatically?
Some says you need to put it the res/raw folder. Again it is not present in the Eclipse project. Do I make one? Shouldn't it be present already?
Please clarify.
Shouldn't it be present already?
It doesn't have to. There can be thousands of folders inside res/ folder. You don't want to have them all at first.
Do I make one?
Yes. Add folders when you need them.
Some answers are to place it in the res/xml folder.
Some says you need to put it the res/raw folder.
The difference between these folders is that files inside raw stay the same you put them and inside xml are parsed when APK is created and put there in a binary, optimized form, similar to what happens to layouts, AndroidManifest and other.

How to load an xml file from android's assets folder by name

I am trying to load an xml file located in the /assets folder of an android project by name using this method:
getAssets().openXmlResourceParser("thefilename.xml");
However, executing this code always throws a "FileNotFound" exception, even though the file is located in the /assets folder and is with the correct file name.
Now, I have not put the file in the /res/xml folder because I really need to be able to 1. edit the file right on the device itself and most importantly 2. add new xml files to the application without issuing an update, to allow for easy user modifications.
Thanks in advance.
I think what you are looking for is either getAssets().open("thefilename.xml") or getAssets().openFd("thefilename.xml") depending on what the end use of the file is. You can see from Dianne's response in this post awhile back that openXmlResourceParser() is not really usable just to gain access to files in the assets/ directory: http://goo.gl/2KfgT
From there you will have a stream that you could feed into a SAXParser or do whatever else you choose.
Side Note: On the points you mentioned you really can't edit files directly in assets/ or add new files to assets/ at runtime. You will need to work with files on either internal or external storage to do those things. You probably already knew that, but I thought I'd mention it.
Hope that Helps!

Categories

Resources