BB10, Phonegap 3.0.0 + FileTransfer

Hello

I'm developing an application with Phonegap 3.0.0 and I have a question about the file transfer.

When the application loads, it checks for new files and download them. Downloaded files must then be stored locally.

I get the system files like this:

window.requestFileSystem (LocalFileSystem.PERSISTENT, 0, gotFS, error);

After that, I get the file and transfer files. The files are stored in the root path: local: / / / persistent.

The problem is that I have been able to show the files in a tag, because I don't understand where the files are actually or how to get them. I've tried local: / / / persistent/filename and file:///persistent/filename and none of them work, I have even tried/filename.

What should I back up the files in a different way to be able to use them in a tag?

Suggestions?

Thank you!

Hello

I solved it, sort of. I used the House instead of dossier_partage and it worked!

Thx for all the help!

Tags: BlackBerry Developers

Similar Questions

  • BB10, Phonegap 3.0.0 + InAppBrowser

    Hello

    I'm developing an application with Phonegap 3.0.0 and I have a problem with the InAppBrowser, it just doesn't work. I added the plugin and still getting the 404 error. Then, I inspected the plugin and found that a readme file in the blackberry10 folder, indicating that the plugin is not necessary for BB10. However, it does not.

    I also tested in Phonegap 2.8.0 and oddly enough it does not work there.

    Suggestions?

    Thank you!

    Hey,.

    Thanks for your response!

    I have just solved the problem myself. :-)

    It seemed that the configuration of the automatic plugin of phonegap kept a reference to the InAppBrowser plugin in the file blackberry10.json, whereas it should not. Deleted manually and the problem was solved!

    The other 2 problems I posted are not yet resolved.

  • BB10, Phonegap 3.0.0 + Facebook

    Hello

    I am developing an application with Phonegap 3.0.0 and need to add the ability to post a message on Facebook. I thought that the best way to go was to create a plugin to be able to invoke the native Facebook application. But that was not a great success so far.

    First, I tried to test the plugin with the plugin base Echo system (as seen in the Phonegap docs). I've downloaded, added the plugin, added the code and tried to run on the device. Unfortunately, I get the 404 error when trying to test the echo, but the plugin seems to init properly. Any suggestions?

    And is there another way to call native Facebook share to Phonegap?

    Thank you!

    There is some information and and example linked here: http://devblog.blackberry.com/2013/02/twitter-and-facebook-cards/

    You can post, even if the code is different, that the values are given here: https://developer.blackberry.com/cascades/documentation/device_platform/invocation/facebook.html

    In addition, about plugins for PhoneGap, we have a model under review for releases in GitHub. It does more than the Echo thing, so it should be more valuable starting point. I guess it will go live sometime next week - when more people are back from vacation to examine it.

  • BB10 - Download the Pdf and view Pdf

    Hi all. I have trouble trying to download the pdf, and then try to view the downloaded pdf file.

    function openLink(urlLink)
    {
      blackberry.invoke.invoke({target: "sys.browser", uri:urlLink}, onInvokeSuccess, onInvokeError);
    }
    

    When the user clicks on a link, the link will be felt openLink function to download the pdf file using the BB browser. This will take the user to download screen to save in pdf format. But when I click on the downloaded pdf file it says

    «The document is empty (size 0 KB)»

    I use the wrong function to download the PDF of the app? If so, how can I download the pdf and allow users to display?

     

     

    Hello

    I don't know why your PDF is coming as 0 k, but what about the download process, and then view, I think that it is perhaps the best solution.

    Use the file transfer API to download the file. As a reminder of the success of the API call, you can then call the PDF Viewer to view the file you just downloaded. Very friendly for the user in my opinion.

    Here are some tools for learning

    API file transfer: https://developer.blackberry.com/html5/apis/blackberry.io.filetransfer.html

    Sample application: https://github.com/blackberry/BB10-WebWorks-Samples/tree/master/fileTransfer/app

    Call: https://developer.blackberry.com/html5/apis/blackberry.invoke.html

    Sample application: https://github.com/blackberry/BB10-WebWorks-Samples/tree/master/fileTransfer/app

    Appeal of basic Applications: https://developer.blackberry.com/html5/documentation/invoking_core_apps.html

  • How to display a progress bar on download the file?

    Hello

    Is it possible to display a progress on the blackberry.io.filetransfer.download function bar? I don't know how to get a file size before downloading from the server? I noticed bbui.js has also a progress indicator that works ok if I knew how to calculate the total size of the file before you download and change the size of the file in bytes on the device.

    Thank you

    Finally, I found a solution for this proglem. You must use html5 XMLHttpRequest to which you can link the onprogress event and calculate procent of the loaded data. https://github.com/BlackBerry/BB10-WebWorks-samples/tree/master/fileTransfer is an example for this, but unfortunately a pure html5 file transfer does not work here because blobbuilder has been deprecated. Thr disadvantage of this approach is that all of the loaded data is kept in memory before writing to a file system and it is not suitable for large files. The device is out of memory and the operating system closes all windows/applications open in the end, it will close even the running application

  • How to download the image of the device using javascript

    Hi all

    I developed the web application. In I want to download the image in the folder in my possible device.if blackberry please give the code for me. Thanks in advance...

    Kind regards

    Marimuthu_P

    I did it with PhoneGap and their API FileTransfer long ago.

    I think he uses XHR - here's a great article on how to do several things with XHR and HTML5: http://www.html5rocks.com/en/tutorials/file/xhr2/

  • Cordova/Phonegap for WebSQL Storage API does not not on BB10

    I use the API of storage for WebSQL to Phonegap with BB10 but his does not work.

    And not able to see the logs in the web Inspector. I have test code on system Z10 bb OS 10.2.

    And cordova 3.1.

    Is there a sdcard is required in the device? Currently, there is no SD card in my camera.

    Or is there any other requirements. Please help me as soon as POSSIBLE.

    Please find my code below:

    index.html

    Sample contact

    Example of

    Database

    You use the document originally of a variable

    window.addEventListener('load', function () {
        document.addEventListener('deviceready', onDeviceReady, false);
    }, false);
    
  • Custom BB Webworks/Phonegap plugin for BB10

    Hello

    Can you please help me how to write Custom BB Webworks/Phonegap plugin for BB10? I knew for BB Java Smartphone (phonegap plugins).

    Hello

    We are working on the construction of full support for plugins to cordova, but for now, you must create a WebWorks extension and import it on the folder your PhoneGap project www.

    Here is a model to help you get started:

    https://github.com/BlackBerry/WebWorks-community-APIs/tree/master/BB10/template

  • PhoneGap / app example Cordova not launching by BB10 Simulator

    I am launching a Phonegap "Hello World" example app in the Simulator BB10.

    As much as I fear, everything has been done correctly. The icon sets even on the home screen, but when I run it I get a black screen with the BB 10 logo in the background and it just hangs.

    See photo:

    I changed the 'project.properties' file in the project by adding the IP address of the Simulator and pointing to the SDK software WebWorks BB 10.

    I do not add the password BB 10 Simulator, because as far as I am concerned it is not a.

    I followed all the directions on Apache Cordova heredocumentation.

    Any help would be appreciated!

    Thanks in advance!

    OK, the problem is that I didn't use the default setting for the installation of the SDK. You MUST use the parameter by default when you install the SDK software to:

    / Developer/SDK/Research In Motion/BlackBerry 10 WebWorks SDK 1.0.4.5

  • Development of a PhoneGap Plugin for BB10 (QNX)

    Hi all

    I'm playing a bit with phonegap 2.5 just to understand how it works with BB10... In addition to the basic steps, I still don't understand what I need to do in case I need to create a plugin custom..., according to the documentation, it seems that the reference language is Java, but as far as I know, the native extensions for BB10 must be developed in C++ and I strongly suspect that Java is for the old version of BB (torch etc.)

    Even if I dig into the sample project located within the archive zip Phonegap, I can't understand how extensions can be made.

    Can someone help me on this?

    Thank you very much

    -marco

    Hi Marco,.

    Yes, you are right! Once we have aligned with cordova, you will still generate native code in the same way, but we allow you to package it as a plugin of cordova rather WebWorks extension.

  • How to get the functionality of the Plugin BB10 webworks development using phonegap.

    Hi all

    How to get the functionality of the Plugin BB10 webworks development using phonegap.

    Thank you all

    Here is a link to the documentation specifically: http://docs.phonegap.com/en/2.6.0/guide_plugin-development_index.md.html

    We will update the things little when we adopt a more close relationship with Cordova.

  • When porting from iOS to WebWorks BB10/7, I have to keep phonegap?

    Hello

    I just get to work for an iOS phonegap app over ports at BB WW and I was wondering: is keeping phonegap is necessary or wise?

    The old app on iOS using phonegap 2.2 (recently upgraded to a very old version) and some plugins such as mapkit (uses that much, I can't just drag the mapping features - like view location on map and directions).

    Aura of the maintenance phonegap and using a version of BB of mapkit (when it exists) be easier than just porting to WebWorks?

    Also keep in mind that I want to port BB10 and OS7 and can - if it's easy - OS5 - 6 and I don't want to have very different code base for different versions of the BB OS.    I already have an older version of java application running on OS4 - 6, but it would be nice to put a new version for old devices also.

    I only did a webworks app but then I don't know much but so sorry if it's a bad question.

    Thank you

    PhoneGap/Cordova supports BlackBerry by calling WebWorks. Cordova doesn't support BB10 until 2.3.0 or 2.4.0, if so you need to update if you want to use. We're going to do also all Cordova the way standard and official to create HTML5 on BB10 applications, so stick to Cordova is sustainably good thing.

    However, I am not aware if there is a port on BB10 mapkit. Certainly, you can do the mapping, but you may need to take one of our samples of mapping and wrap it up in the same API if you want it to run perfectly.

    Now, porting to OS7 should be OK, but when you talk to will OS5 and 6, you may encounter more problems. At this point, those are very old devices. The engine of the browser in them is a good few years old - OS5 does not also WebKit. Memory and processors are half of what's available in devices OS7. You have to be very effective to make it work as you want.

    It is difficult to give really good advice without knowing your target market, demographics, and the region, and what kind of features you want to deliver (in addition to the maps). These factors will determine what kind of userbase you can expect on the different versions of the OS, and that it is better to port PhoneGap version for old phones, or update the Java version. Take a look at the BlackBerry World user stats that we publish and your own user base numbers. Generally, we found that users with the latest hardware equipment are also those who buy apps or spend money on them, and those with more recent or fairly recent devices is those who download. Make sure that you balance the available opportunity development times.

  • ondeviceready not shooting in application phonegap bb10

    Hello

    I am developing a HTML5, JQuery basic application with corodova (phonegap), but several times, I found that app video plays (which is my fist in html5 section) and then app does not pass to the next article, I guess it's perhaps because of ondeviceready not firing I see newspapers on my debugger like this.

    ondeviceready not fired for more than 5secs.

    Please let me know, how it can be solved.this happens at least 4/10 times.

    Hi all
    This problem is now resolved.
    It is because in our application, I was first playing a video via the html5 video tag then go index.html, which stops because of error 'onstalled', which is common, so I solved by successcallback that i do the same thing for "onended" video event.
    Here there is no question of Cordoba at all, it was sometimes true, but sound as rare as 1 in 50 times.

  • An error not handled during construction or the app runnning a Cordova/PhoneGap BB10

    I'm trying to implement a project of 10 BlackBerry with Cordova/PhoneGap 3.0.0.

    It took me a long time to understand the Platform for BlackBerry 10 guide actually refers to the version available on http://cordova.apache.org/ and must be installed noted differently on the first page of the site Web PhoneGap.

    I have successfully created a project and added my Z10 camera as target.

    However, when you try to run 'build debug z10' or "run z10" I always get the following error message:

    events.js:72 throw er; // Unhandled 'error' event
    
    Error: spawn ENOENT
    at errnoException (child_process.js:980:11)
    at Process.ChildProcess._handle.onexit (child_process.js:771:34)
    

    Any solution to this?

    We've tracked down the cause of this error to the tools BlackBerry NDK is missing from the system path.

    After you have installed the BlackBerry native SDK, tools must be added to your system path. Manually add the bin directory to your path, or run the following scripts in the directory where you installed the NDK:

    Windows

    bbndk - env.bat

    Linux/Mac

    source bbndk - env.sh

    Note: the script execution will only add tools to your path for the current shell. If they persist, you must add the path to the bin directory using the Windows or Linux/Mac bash profile environment settings.

  • And then visualize it PhoneGap/Cordova download file to the device

    I'm doing a magazine app that downloads images to the device for the magazine can be read when offline or with a bad internet connection.

    I use PhoneGap/Cordova version 3.1 with 10 of BlackBerry and plugins file and file transfer. I made a few changes to my code base that runs on Android and iOS since before he could download files on the Simulator. Ensure the directory that I wanted to save the file to exist and access to the file with the path indicated in fs.root.toURL ().

    But now that I got the files uploaded to the device I can't view. On other platforms, I was able to use theFileEntry.toURL () and set it as the source for an img tag. But for BB10 I see only an empty img tag. =/
    The specified local path is: filesystem:local:///persistent/bblogo.png

    I was searched and seen references to disabling sandbox and by saving the file on blackberry.io.shared or blackberry.io.home, but blackberry is not available for me with PhoneGap 3.1. Looking at the native documentation , that I saw that the shared path is/accounts/1000/shared but trying to browse the file system I am told that the path does not exist. (fs.root.getDirectory ('accounts') to start with).

    I have a GitHub repository with what I'm looking for here: https://github.com/gaqzi/phonegap-bb10-file-transfer-test
    The code in question is here: https://github.com/gaqzi/phonegap-bb10-file-transfer-test/blob/master/www/js/index.js#L38

    I also noticed that the size of the file when the download is complete is much larger than the actual size of the file on my computer. And the same code running on iOS I see not enough to increase the size of the file. I don't know if that has to do any.

    To try to combat the current file size wildly different I coded an image 10 x 10 pixels as Base64, she decoded on the device and saved. Now, he pointed out the same size on my computer and the device, but still can not see. The same exercise done on iOS gives me a visible image.

    For the code on the test of Base64, please see my thread Stack Overflow for this: http://stackoverflow.com/questions/19421245/blackberry-10-cordova-phonegap-3-1-filetransfer-image-do...

    I am at a loss what can I do to access the files I created, anyone has an idea?

    Hello

    The patch for the cordova file api is still ongoing. Until that of land, here is an example for download of an image and inject it into the DOM. It uses XHR, but the filetransfer plugin should work as well.

    https://gist.github.com/jeffheifetz/c1127b4d3e132ffff972

    You will need to 'blackberry.io', which is available as plugin PhoneGap/Cordova here:

    https://github.com/BlackBerry/Cordova-BlackBerry-plugins/tree/master/plugin/com.BlackBerry.IO

    The patch will automatically update toURL so that it returns the full path which has been hard-coded in the example.

Maybe you are looking for