Phonegap + JQM - Phonegap.js? - jquery-mobile

I am just getting into building a basic app using JQM and Phonegap.
I am using the Phonegap Cloud Builder and so far everything is OK!
But now I want to try and use some of the phones features e.g. the camera. I have read about people doing this successfully using JQM, but the hurdle I am stumbling on involves 'phonegap.js'
As I understand, this file is created typically when a new project is created (using Eclipse of XCode etc). My 'app' is being created by hand (hence using the Cloud Builder) and therefore I have no access to phonegap.js.
All the documentation I find is old and says the files are in the zip download, but they are not. I also figured that the Cloud Builder creates this file, but no idea where it places it in relation to the index page for me to reference it.
So, how can I get hold of the phonegap.js library to use the phones camera, when I am not using an IDE (this is likely to change if there is no way to get the file without one)

Download PhoneGap here: http://phonegap.com/download/, depending on platform you are developing follow appropriate tutorial included in documentation. Ether way you will be having www folder inside your project with phonegap.js file in it. Copy your jQm web application to www and append phonegap.js file in of your index.html. Now you will be able to compile native application that can access phone resources.

Related

How to generate "platform.h" in a Xilinx SDK Project?

I'm currently working on a Zynq-7000 Software project using Xilinx SDK toolchain.
I've noticed that nearly all of Xilinx's Demo projects automatically generate a "platform.h" file. However, when I start from an empty project in the SDK IDE it never generates "platform.h". This normally this would not be a problem, however, I want to cut and paste code from the "demo" project into my empty application project, and I can't do this because the "demo" projects rely on the "platform.h" header file. (I could create the demo project and delete every file from it, except platform.h, except this solution doesn't work because I need to modify the hardware away from the defaults with a custom FPGA image.)
What's the secret to get Xilinx SDK to auto-generate the "platform.h" file for an empty SDK Application?
For instance, is there an obscure checkbox that I need to click somewhere in the Board Support Package Project that says generate "platform.h"? or something like that? no idea...
It turns out that "platform.h" and "platform.c" are just normal c-code that are part of the Xilinx demo project. This code is not generated automatically generated as part of the Board Support Package. Thus, you can simply cut and paste these files into your new project without causing any problems. This is why an empty Application project doesn't contain these files.
The reason why they called it "platform.h" was just to hide the API differences between different Xilinx CPU types. Thus, the same demo code compiles on multiple platforms.
If you are like me an only using the Zynq-7000 platform, you can simply delete everything else in the platform files that's not related to Zynq-7000.

Cordova plugin that allow users to browse files and upload the selected files (iOS)

Is there a plugin Cordova that allow users to browse files, pick a file and upload it on iOS? I found only 3 plugins: File Opener 2 plugin, Cordova plugin file and File Transfer plugin but they do not meet my need.
Did anyone do that ?
iOS
Quote from Mike Harrington (Ionic Developer Advocate)
For iOS, you sadly don't have a file browser/chooser.
Not going to be possible sadly.
source
But (same source) according to a user on the same forum
Apparently there's this one, haven't tried it and sadly it's only for
iOS8 (and higher?):
FilePicker-PhoneGap-iOS-Plugin
Anyway I suppose that if you understand the physical file system
structure of iOS and you have the time then you could always build a
UI yourself using the Cordova File plugin. Don't know about iCloud and
so on though.
By the way, I tried Cordova-filechooser and it worked perfectly.
The other one seems more
complicated to set up and gave me build errors on my initial attempt,
so I went with the other one.
Android
Using the cordova-filechooser plugin in combination with the File Transfer will probably resolve your issue.
Image taken from cordova-filechooser's git repo
Use this to select your files. Use File Transfer to transfer them.

FlashDevelop - Loading external swfs on iOS

My application needs to load external swfs with ABC. I checked that this feature is available in AIR 3.7 and later. I managed to get the new SDK - 3.8 with the latest version of FD (4.4.3).
Now I am following this link: http://blogs.adobe.com/airodynamics/2013/03/08/external-hosting-of-secondary-swfs-for-air-apps-on-ios/
According to this post, "During IPA packaging, ADT extracts the ABC code from all child SWFs, adds it to the final executable and generates stripped SWFs in the “externalStrippedSwfs” folder created in the current working directory. The directory structure within the “externalStrippedSwfs” folder remains the same as specified within the text file. The generated stripped SWF’s should then be externally hosted on a web server of developer’s choice."
However, firstly, I could not find any such folder called "externalStrippedSwfs".
Secondly, even if this works, this means that everytime I have a new external swf to load, I will have to get it stripped off the code, put it in the main swf, and then upload the stripped swf (with assets). So everytime I do this, I need to "reupload" my app to Apple.
Are these assumptions right? My app architecture will need to be modified accordingly.
Yes, your assumptions are correct: You can't load an external .swf containing AS3 and have the app execute the byte code.
If we ignore the fact that it would most likely not be approved by Apple it can't technically work. The reason is because the Adobe AIR app doesn't contain a virtual machine capable of interpreting the byte code in the .swf:
When you build your application for iOS, there is no interpreted code
and no runtime in your final binary. Your application is truly a
native iOS app.
Source: http://www.adobe.com/devnet/logged_in/abansod_iphone.html.
You can do it! :) You just need to upgrade to AIR SDK3.8+ and follow the painful process.
The only limitation is that each external swif that you will be loading at run time, must be stripped by your ADT.
But you are right: you will need to update your app everytime your external content needs to be updated.
"externalStrippedSwfs" is arbitrary (name it as you wish I believe), you have to create that folder in your bin and run the command line from there.
Looks like Apple is not ready to lose the leash yet...

iOS file downloading library

In my iOS app I use HTML5 files as game levels. New levels will be added in the future, so I need to create a smart solution that will sync files on device with files on the server each time a new file is added or an existing file is updated on the server. Ideally it should work like SVN update. Is there any existing library that solves this problem?
you can use a web service, you will have to implement it on your server [with your favorite language-framework ie: php-codeigniter, python-django, ruby-rails]
I recommend using JSON for simplicity.
on your iOS side, with iOS 5 you can use NSJSONSerialization

Can PhoneGap be used in apps built with theos?

I want to use PhoneGap to make a Cydia app, however the iOS instructions on their website only show how to use it with Xcode.
I don't have a Mac, but I'd like to be able to make my app for Cydia, with theos. Is this possible with PhoneGap, or is it only usable with Xcode?
I've never done this, but YES it should be entirely possible. The Xcode instructions set it up for you to have a specific template with all of the phonegap files already in the proper locations. So it's easy to get going. But it doesn't do anything else that is particularly special. Theoretically you could simply setup all of the files in a theos project.
To do this you will need to 'reconstruct' exactly what goes into a phonegap template. I have no experience with theos, but a rough idea of what you will need to be able to do includes the following:
Import PhoneGap.framework
Reconstruct AppDelegate code
Import Supporting Files (PhoneGap.plist)
Additionally you will need to configure the folder structure with the www folder (that the webview loads from) including the index.html file and the phonegap-1.0.0.js file.
So yes, it should be possible. Let me know if you are successful. Good luck!

Resources