Welcome, Guest
Please Login or Register.    Lost Password?

Accessing low level device APIs
(1 viewing) (1) Guest
Convertigo Products
This is the place to ask questions, request for enhancements and more generally discuss about Convertigo products.
Go to bottomPage: 12
TOPIC: Accessing low level device APIs
#238
Accessing low level device APIs 1 Year ago Karma: 0
Hello,
I have one question about accessing low level device APIs from the mobilizer App.
Q1. Can we call the low level device APIs from the mobilizer App may be from inside the secha code?

Q2. This is something more specific to Sencha and PhoneGap but using this inside Convertigo Development. Can you please show me a piece of code snippet where a low level device API is called from the mobilizer App. I understand that the mobilizer app (which we can generate from the Convertigo Studio) is a web app and PhoneGap takes this and builds a native (or can I say a Hybrid) app. I also understand that the PhoneGap adds a very simple JavaScript API which provides access to low level device APIs. If this is correct, as a programmer I feel that the PhoneGap's Javascript API should be called by some function from the sencha framework and then the PG's JavaScript API calls the relevant device API.


Regards
Tapas
And thanks for your prompt replies as always
tapas.dixit
Fresh Boarder
Posts: 14
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#239
Re:Accessing low level device APIs 1 Year ago Karma: 1
Hello,

As you know Convertigo uses PhoneGap to generate the Native APP. The questions you ask are related to PhoneGap technology.

For Q1 , yes, PhoneGap enables Sencha or JQuery Mobile code to call some low level Apis such as the sensors, camera and a lot of other stuff. see the PhoneGap API for that.

docs.phonegap.com/en/1.8.0/index.html

For Q2, You are totally right. This is why Phonegap.js is included in your project when you create a mobilizer project. You call from the Sencha framework the Phonegap.js functions that in turn calls some device specific code.

Please find attached a .CAR showing how to call the devices's Camera feature. see the functionCamera.js file.
File Attachment:
File Name: functioncamera.txt
File Size: 2361
admin
Convertigo Team
Posts: 108
graph
User Offline Click here to see the profile of this user
Last Edit: 2012/06/08 08:41 By admin.
The administrator has disabled public write access.
 
#240
Re:Accessing low level device APIs 1 Year ago Karma: 0
Great.. Thanks for the information. Will have a look into the CAR file
tapas.dixit
Fresh Boarder
Posts: 14
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#453
Re:Accessing low level device APIs 2 Months, 3 Weeks ago Karma: 0
Hi,

I'm working on a jQuery Mobile project and getting problems to call the devices's Camera feature.

For the moment I'm trying for Android with PhoneGap, I followed PhoneGap API Documentation but I did not manage to get it work because the structure of a Mobilizer project is not the same as they use with PhoneGap.
And my Mobilizer project does not contain some files they use, like the AndroidManifest for example.

Is it possible to use PhoneGap functionalities with a jQuery Mobile project ?

If yes, can someone show me some examples please ?

Or may be you could re-attach the .CAR file from the older post, because I can only see a file that I suppose represents the functionCamera.js file.
JHKSocomec
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#454
Re:Accessing low level device APIs 2 Months, 3 Weeks ago Karma: 0
Hi!

Yes, it's possible to use PhoneGap with jQuerymobile. Find attached a sample project as a .car file. You will find in this example how to scan a barcode, which is another functionality of the device accessed by PhoneGap.

In your project, to use the camera, you need to:

  • add or uncomment the following line in headers of your HTML files: <script src="cordova.js" type="text/javascript"></script> (for example, index.html or other HTML files that are located in your project's resources, in DisplayObjects\mobile folder),

  • use the camera functionality of PhoneGap API, as found in the PhoneGap documentation,

  • set your config.xml file that can be found in the DisplayObjects\mobile folder of your project's resources,

  • build your application in the Convertigo Test Platform, and test the application.



To help you about building your application and testing on Android phone, read this page of the Mobilizer project documentation. This example is based on Sencha but it does not change the build and test procedure.

About the AndroidManifest file and other files from PhoneGap that you do not find in the project, it is completely normal as it is the Convertigo build that will add these files in the APK.

Remember that it is only possible to use and test these functionalities in a built and installed application.

We hope this will help! Keep us updated about your tests.

Laetitia.
File Attachment:
File Name: phonegapBARCODE.car
File Size: 1351770
laetitia
Admin
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2013/03/25 17:45 By elodiee.
The administrator has disabled public write access.
 
#455
Re:Accessing low level device APIs 2 Months, 3 Weeks ago Karma: 0
Great, Thanks Laetitia that's exactly what I needed.

I'm facing another problem now, I just wanted to test your .car file so I imported it in Convertigo Studio and tried to build the application.

But when I click on the build mobile devices button, I get an error saying :

"Build Error : Connection refused : connect"

I read the Mobilizer project documentation page you gave me, and I'm sure my PhoneGap build account parameters are correct.

But I can't find what's wrong..

I'm working on localhost in Convertigo Studio, I'm not sure about my Built application endpoint URL, here are my params :
- Built application endpoint : localhost:18080/convertigo/
- Application ID : com.convertigo.mobile.phonegapBARCODE

I thought my proxy configuration was wrong but I tried several configs and I always get the same result. (Maybe my proxy config is still false)

And finally I tried to build different projects but always get this error.
JHKSocomec
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 12
Moderators: elodiee

btn developerNetwork_home

If you are a developer, an architect and more generally someone looking for technical information about our Mobile Enterprise Application Platform, Composite Applications and Convertigo, this is the right place for you.

btn downloadC8O_home

Get Convertigo Studio for Windows. This is our Eclipse based development tool for our Mobile Application Development Platform. You can get also Convertigo Servers for Windows and Linux directly on sourceforge

btn documentation_home

Find our official documentations for Convertigo Mobile Application Development Platform and and Mobile Server, including the Reference Manual, the Programming Guide, and the Installation Guide, in both HTML and PDF formats.