PhoneJS - launching Demos - android

I have one simple question conserning PhoneJS http://phonejs.devexpress.com/Documentation
and it's demos - how to launch and preview them on Android devise?
I've loaded a package and tried to run demos through Eclipse, using
webView.loadUrl("file:///android/html/index.html");
But only black screen is visible.
Thanks!

I also not found this PhoneJS information in documentation. I wrote to support and they told me PhoneJS application is like any PhoneGap based application can be packaged with PhoneGap and in http://build.phonegap.com site.
PhoneGap Build worked well, but it is little slow.
Do you see any errors or simple black screen?

Possible files, mentioned in the index.html file, are spelled in the different case from files on the disk, e.g. you have line
script type="text/javascript" src="data/db.js"
but on the disk there is "Data" (not "data") folder or "Db.js" (not "db.js") file.
It makes sense then application is uploaded on android device. You should ensure file names spelling.
Thanks, Serge

Related

Using assetbundles with streaming assets folder in Unity Android

I am loading a local assetbundle, which is located under streaming assets folder in my Unity game. I am using a simple code to do this:
Assetbundle assetbundle = AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath,"myresource"));
This code is working perfectly fine but according to Unity documentation and forums, it should not work at all in Android due to fact the streaming asset will be zipped under a path like this: jar:// url.
The following statement is from Unity documentation:
To read streaming Assets on platforms like Android and WebGL, where you cannot access streaming Asset files directly, use UnityWebRequest.
I have created an aab file and tested this code in ARMv7 and AMRv64 devices and it worked perfectly fine.
Unity's documentation is usually outdated so I really wonder if I should move this code to production or not.
Can someone shed a light on this ? Did they somehow fix this ?
It is working as intended and you followed the documentation. Good job, no problem here.
In older times the recommended method was the WWW class, but this class is deprecated now. The documentation on this bit changed for Unity 2018.4, thats quite recent.
Page on StreamingAssets does says that
To read streaming Assets on platforms like Android and WebGL
, where you cannot access streaming Asset files directly, use UnityWebRequest. For an example, see Application.streamingAssetsPath.
but here is the reply from Unity on the forums (and a related "Fixed" Unity Issue), so the issue with bundles was fixed even in 5.3.* and you should be able to use AssetBundle.LoadFromFile on Android. StreamingAssets documentations seems to be correct, it just doesn't mention that there is a special case for reading assets with AssetBundle.LoadFromFile. LoadFromFile documentation also doesn't mention it, but uses streamingAssetsPath as an example.
There is also an alternative to use BetterStreamingAssets that builds the map of files and their offsets in the apk, and then passes the correct offset as one of the AssetBundle.LoadFromFile arguments, although not sure how it handles the compression in that case.

Android API guides (with figures) for offline use

I'm looking for a possibility to browse the android API guides offline (with figures). I read several questions about this here (ex. 1, 2, 3...) and tried to get offline docs from the sdk folder or using a direct link. The problem with the actual version (23_r01) is that the images are often not displayed. For example in the page sdk/docs/design/index.html the image hero-material-design.png could not be displayed because of a bad src tag.
What I've tried:
Using the docs from the SDK folder
Direct download from https://dl-ssl.google.com/android/repository/docs-23_r01.zip
Saving the files using HTTrack (I'm getting errors here..)
What I would like to achive:
Download a correct version of the docs
OR "Repair" all the broken image paths in the html files
I would appreciate any help.
If thats still interested to you, just edit \docs\design\index.html, add .. before /design (it means the parent folder, one dot means the current), like that:
<img class="dac-hero-image" src="../design/media/hero-material-design.png">

ng-include not work in PhoneGap

I am trying to build my angularjs app into an android app using PhoneGap Build, but got stucked with the issue of the src of ng-include.
The code below tries to render a html of subheader into the view. It works perfectly in chrome browser, however after I convert the code with phonegap, it does not work. I also tried other path like '../templates/subheader.html' and '/templates/subheader.html', none of them work.
<div class="bar bar-subheader bar-stable" ng-include="'templates/subheader.html'">
</div>
Any suggestions?
It is embarrassing to always answer my own question...
However I finally figured it out.
1. The path inside the ng-include should not have the "/" on its left most.
2. The key of this issue is not the ng-include. It is because I was trying to fetch a variable stored in the $cookieStore:
For some reason I don't know, the data stored in $cookieStore can't persist between page transition. It impact many components in my page. So I have to change the $cookieStore to another local storage service https://github.com/grevory/angular-local-storage.
I had the same problem, that my include was not shown on the device.
But my problem was that I put the template in an folder which's name started with an underscore _.
This is ignored in the build-process. Renaming the folder helped!
Did you have a chance to look at Ionic Framework ? It works on phonegap and has build in AngularJS support. It also has some mobile ready components.

Issue Debugging Reason XML Won't Parse

I am having some difficulties with my android app parsing an xml that contains links to PDF files. It should open a listView showing all of the files listed in the xml. However, most of the time it just freezes up on me. The app was made by a developer no longer with us, and all I have is the apk and not the source files. Is there a way to use the apk to get the source files and figure out what the issue is? Android is not my forte and I'm at a loss with how to fix this.
UPDATE:
It appears that devices running 2.2 display all the songs just fine, while the newer versions of Android crash when ran.
I've had problems with android 2.2 on my HTC desire taking a long time to parse large XML files. There wasn't much I could do other than switch from DOM to SAX which for some reason was a lot quicker
However debugging this without source code is likely to be pretty difficult. Not least because fixing the issue when and if you find it will require you to re-compile a new class in replacement for the one which keeps freezing.
I would suggest you look into decompiling the APK back into source code.
According to Wikipedia APK files are based on the Jar file format which in turn is a Zip file:
http://en.wikipedia.org/wiki/APK_%28file_format%29
That makes this task a little easier as you won't need to look for a decompiler that is specific to android but a more generic Java Decompiler.
A quick search on google suggests this one:
http://java.decompiler.free.fr/
If you can decompile the app back to source code and then get that source code into eclipse and rebulild from source then you can start to debug.

Android & iOS: Best way to create multiple similar apps

I've created an app which pulls data from a JSON file and displays it.
Now that app is specific for one sports team. I want to create the same app for 10 other teams.
Plus there will be an accompanying pro version of the app.
I'll be doing the same thing for the iOS version.
The only difference between the apps will be colors, logos and url of the data source.
I wanted to know if there was a better way to create apps. Instead of individually creating 40 different projects.
It will help me in updating the app as opposed to copy pasting the same code 40X.
Are there any special features available in eclipse and xcode to do that?
Thanks
I would simply swap out the resources for each team and rebuild the app.
For example, with Android, maintain an AndroidManifest.xml and a res/ subdirectory tree for each team. When it is time to build, simply copy over the resources into the project, overwriting the previous team.
I don't know of any existing tool to do this automatically, however.
Have you looked into using PhoneGap and just create a "mobile site" that detects the app that is connecting and adjusts the data/styles accordingly.
There's always the possibility of creating ONE app allowing the user to set the team preference upon first load, and swapping out resources programmatically.
With Titanium Studio you can write code using Javascript and it convert your code in native objective-c code, native android code, native html 5 code and soon also in windows phone code. It`s the best free cross platform IDE
Upon reviewing your responses, you seem to want a strategy to manage your resources. Since different OS has different resource requirements (screen-size, iOS 2x png for example). The most common strategy is to keep a separate resource structure and setup build target to copy/xcopy replace these image resources before build. Source control + an OSX build server would be most beneficial.
After creating these apps I've found the following way to be the most easiest way to create a similar app.
Android:
1. Select the project from the project explorer sidebar copy it and then paste it. Give it a new name.
Select the new project and then right click > Android Tools > Change Package Name.
Give it a new package name. Eclipse will give you an option to refactor the code, say yes.
Go to res/values and change all strings.
Change the icons and other images.
Go to src click the package and then refactor it. Give it the new package name.
Go to manifest file and rename any old names which might still be lingering.

Categories

Resources