How I can create a app with intel framework and phonegap

How I can create a app with intel framework and phonegap

Hi everyone

I had created my entire application using the framework of intel with their roles, resources. I thought the great framework.

In the end, I came across a barrier. I have a form where one hits a photo or choose from gallery and send a message with this photo. Turns out my webservice today does not allow file uploads. So I have to send a string (base64) for the server.

Had already done so in another app that used only with phonegap and the zepto js, which I thought was super simple, requiring only a parameter. I tried to do the same without using phonegap, but without success.

I tried to use canvas to convert, but always gave javascript error, tried to use a library that is where php.js would use file_get_contents + base64_encode but also gave error. I'm a little lost, trying for four days to make it work, but without success. So I'm thinking about using phonegap with the intel app framework, only the function of the camera, but it is a question: How do I do that?

So I have some questions and hope you can help me.

1 - The intel app framework really has no function that I can use to convert an image into a string (either at the time of capture of the camera or taking an img element by id)?
2 - How would my script call for ondeviceready? I have one of phonegap and the AppMobi.device.ready? Or would one inside the other? Would you like an example
3 - In part of libs, I need to read some additional lib, as cordova.jar that comes in the download package?
4 - How I could see inside the XDK emulator phonegap functions work? Is it possible?
5 - How do I generate the apk, still using the XDK build or would use the phonegap build?
6 - If the apk has to be generated using the phonegap build, I would have to copy the folder inside my app the 2 javascripts that are called via the url localhost?

Leveraging other 2 questions about the XDK itself.
1 - What is the xhr.js?
2 - What is the xpromo.js?

Since I thank you for all the help they can reply this topic.

5 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

Hello Paulo,

Excellent set of questions, I'm not going to be able to answer all of them without some further investigation, but ill try to answer a few here.

First, please note that our primary support for the Intel XDK is actually on a different forum. I know this is confusing, so I've updated some of the notices to help people get to that forum more quickly. The link to that forum is: https://forums.html5dev-software.intel.com/.

1.) I'm not aware of any API methods that would support the conversion of an image from binary to a string. Seems like there should be a JavaScript library out there to help; after some searching I found this: http://jsfromhell.com/classes/binary-parser, which is also referenced from here: http://thefrozenfire.com/2011/01/client-side-javascript-nbt-decoder/.

2.) Use the AppMobi.device.ready. Also, please note that the version of PhoneGap that is supported by the current edition of the Intel XDK (as of May, 2013) is PhoneGap 1.0. Support for Cordova 2.x will be added in a future edition of the tool.

3.) Not sure I understand this question, but I think what you are asking is if you need to provide the native bits for the PhoneGap support. When using the XDK, you include a reference to an XDK-specific version of phonegap.js in your app. The build service then takes care of providing all the backend native code needed to support the PhoneGap API (currently only version 1.0) that is referenced in that phonegap.js file. Please see some of the PhoneGap demo apps (change to "phonegap" mode within the emulator to see these apps).

4.) The ony code you can see inside the XDK emulator is JavaScript, you cannot see the native code.

5.) If you are using the Intel XDK API you must use the XDK to build your APK. The build is cloud-based, meaning you do not need to download and install the Android SDK or the PhoneGap SDK.

6.) See answer to 5.) above. Projects built against the Intel XDK are not currently compatible with PhoneGap Build, although, with some effort, you can turn them into projects that you could submit to PhoneGap Build, but only if you do not use any of the AppMobi namespace functions.

Please refer to the https://forums.html5dev-software.intel.com/ for further information.

Paul

Thank you very much Paul.

Now I'm using a Phonegap 2.5 

to meet the needs of my project.

But I'm having problems. Had this problem before using only the intel XDK, but the problem continued even using the appMobi ui plus the phonegap. Did tests generating the APK using the XDK Build (without phonegap), XDK Build (using phonegap 1.0), PhoneGap Build (using phonegap 2.5) and eclicpe (using phonegap 2.7).

It turns out that for all the links of my application and inputs when I click or when I hold the click, appears a layer overlying a rectangle of color like yellow, fading and only after opening the link. Can you help me with this? This only occurs on application installed on the emulator and the web version is not the effect of ghostclick.

This would be a problem, another problem is that when I use phonegap, I get the error "Uncaught TypeError: Object # has no method <Object> 'launch'"

$.ui.autoLaunch=false;
$.ui.resetScrollers=false;
$.ui.openLinksNewTab=false;
app.initialize(); 

var app = {

// Application Constructor
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
onDeviceReady: function() {
pictureSource=navigator.camera.PictureSourceType;
destinationType=navigator.camera.DestinationType;
navigator.geolocation.getCurrentPosition(exibePosicao, geolocationError, navOptions);
$.ui.launch();
$.ui.backButtonText="Voltar";
window.setTimeout(function(){$.ui.launch();},1500);
}
};

Hello Paulo,

Do you see the yellow ghost layer problem in a built application running on a real device, as well, or only when you run your app inside the XDK emulator?

Looking at your code snippet, I would say that your app.onDeviceReady() function is getting called too early. It's not clear when you are loading the jq.ui.min.js library from your snippet. Perhaps this snippet from a working app will help (this is configured for a PhoneGap app).

Paul

var app = {

  initialize: function() { // Application Constructor
   this.bindEvents();
   },

  bindEvents: function() { // Bind Event Listeners
    // Bind any events that are required on startup.
    // Common events are: 'load', 'deviceready', 'offline', and 'online'.
    document.addEventListener("deviceready", this.onDeviceReady, false);
  },

  onDeviceReady: function() { // deviceready Event Handler
    // The scope of 'this' (above) is the event.
    // Thus, in order to call the 'receivedEvent' function, we must explicity call 'app.receivedEvent()'
    app.receivedEvent("deviceready");
    pgDeviceReady() ; // start my application
  },

  receivedEvent: function(id) { 
    console.log("Event received, id: " + id) ;
   }
};

function initApplication() { // runs once the page is loaded, but before appMobi is active
  app.initialize() ; // initialize bind events before we look for the deviceready event
}

p.s. the "pgDeviceReady()" function in the app.onDeviceReady() function is not shown here, but that is where the app actually "starts" after the wait for the PhoneGap initialization is complete. You need to wait for the underlying PhoneGap code to initialize, and that is what the app.onDeviceReady() function does for you. 

Hi, Phonegap it's a universal converter tool between the development language .

JudLup Luna

发表评论

登录添加评论。还不是成员?立即加入