Creating extensions Webworks by Cascades
Hi all
I know that we can create Webworks extensions with c ++ and the frame JNext... but it is still not clear to me whether I can use stunts API as well. For example, I would need to create a custom HttpRequest module and inject it into my code js as an extension of Webworks: if I look at the low level of the native SDK APIs, I don't see any 'network manager' I can exploit. Instead, Cascade API provide the QtNetwork module that seems to fit my needs
https://developer.BlackBerry.com/Cascades/documentation/device_comm/networking/index.html
So the question is: can I use this in my C++ code to make my own Webworks extension? As far as I understood, waterfall is simply trying to create a distinction between the UI and the logic of low level, so I should be able to do...
Thank you very much for your time
-marco
QNetwork is part of the Qt framework, which is a library of c ++.
You should be able to use all native classes, including Qt, as long as they are not the user interface.
Tags: BlackBerry Developers
Similar Questions
-
How to include the shared library of BlackBerry in a native extension WebWorks
I developed a native extension WebWorks that works very well on Simulator and devices when included in a webworks app.
I also have a sample of waterfalls project with the same code base that I use to test the WebWorks extension code.
Since a large part of the code is reusable, I decided to create a shared library of BlackBerry, so I can reuse in other projects. When I include the NEW shared library in the waterfalls and then everything works well, as before.
When I include it in the extension WebWorks it draws very well. The .so file size was much smaller and that worried me (I suspected that the shared library was not included in there). But since its construction very well I went trying to run my application webworks. When it came to hitting the extension I got a ' need of error. Cannot find the library of blah/blah/...so'.
I had this before and found out that it was because the dependent QT libraries have not been correctly referenced. It so that the shared library is not properly referenced/copied /-thing... This event is supported? For example, by using a custom in a WebWorks extension shared library?
It worked
Version 2 is almost right
In the library paths pane Add...
${workspace_loc: / / extlibs/device$ {ProjName}}
for peripheral and do Simulator
${workspace_loc: / / extlibs/Simulator of ${ProjName}}
Always with libname in libraries
I just linked to unrar successfully like this library
Whew - they do this hard work of stuff
-
'illegal start of expression' error then you are trying to compile an Extension WebWorks
Hello
I'm trying to compile a simple Extension of work Web to show a Dialog.alert (), just a simple code to start with Extensions WebWorks. The problem is that when I try to compile my code with javac I get many 'illegal start of expression' errors on the scene who has any errors. Here is the log from the console:
Nathan-Camposs-MacBook-Pro:webworks Nathan$ javac -source 1.3 -target 1.3 -deprecation -classpath /Developer/Applications/Eclipse/plugins/net.rim.ejde.componentpack6.0.0_6.0.0.43/components/lib/net_rim_api.jar -sourcepath /Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/* /Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:15: illegal start of expression public static final String FIELD_ALERT = "alert"; ^ /Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:15: illegal start of expression public static final String FIELD_ALERT = "alert"; ^ /Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:15: ';' expected public static final String FIELD_ALERT = "alert"; ^ /Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:16: illegal start of expression private Alert _callAlert; ^ /Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:18: illegal start of expression public AlertScriptable() { ^ /Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:18: ';' expected public AlertScriptable() { ^ /Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:22: illegal start of expression public Object getField(String name) throws Exception { ^ /Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:22: ';' expected public Object getField(String name) throws Exception { ^ /Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:22: ';' expected public Object getField(String name) throws Exception { ^ /Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:22: not a statement public Object getField(String name) throws Exception { ^ /Users/Nathan/BlackBerry/WebWorksTest/webworks/src/org/webworks/os/interation/AlertScriptable.java:22: ';' expected public Object getField(String name) throws Exception { ^ 11 errors
Any ideas?
Best regards
Nathan Campos
I solved this. I was saying that all inside a constructor.
I'm sorry.
-
allows you to set the callback function to extension webworks
I see in BBM webworks API, the callback function (blackberry.bbm.platform.onaccesschanged) is defined as a field variable, then call the register function.
Is the only way to pass a callback to webworks?
You can pass a callback function as a parameter to a function call?
In my exercise, I tried to define an acceptable extension webwork function a ScriptableFunction as one of the parameters. When I pass the function() {alert("test")} as an argument, the webwork expansion feature does not work. The debugger displays the webworks function is not called when I try to get to the function as an argument.
June
Hi June,
A callback function right at the method as fact in good number of our API, you can actually pass. On the top of my head, take a look at the readFIle API. You can find the source of the code here - https://github.com/blackberry/WebWorks/blob/master/api/io/src/main/java/blackberry/io/file/ReadFileF...
You should be able to move from the ScriptableFunctions back with no problems
-
How to create several classes of cascade?
Goal: Create the button to start and stop the service.
Situation: One button works.
However, whenever I click on another button, the button does not work.
Question: how to create several classes of cascade?
or something wrong in my code?
Mini code:
Calls a CPP QML.
ApplicationUI::ApplicationUI (bb::cascades:Application * app): QObject (app)
{
QmlDocument * qml = QmlDocument::create("asset:///main.qml").parent(this);CameraWrapper * wrapper = new CameraWrapper();
QML-> setContextProperty ('wrapper', wrapper);
AbstractPane * root = qml->
() createRootObject;
App-> setScene (root);
}And then, QML calls another RPC.
import bb.cascades 1.0
{Page}
{Of container
layout: {DockLayout}
}
Button {}
text: qsTr ("Start")
onClicked: {}
wrapper.startRec ();
}
}
Button {}
text: qsTr ("Stop")
onClicked: {}
wrapper.stopRec ();
}
}
}
}The main CPP:
#include "cam.hpp".
using namespace bb::cascades;
{CameraWrapper::CameraWrapper()}
int CameraWrapper::startRec() {}
This button works.
}
int CameraWrapper::stopRec() {}
This button does not work.
}
The main.hpp
Class CameraWrapper: public QObject
{
Q_OBJECT
public:
CameraWrapper();
Virtual ~ CameraWrapper() {}Q_INVOKABLE
int startRec();
int stopRec();
};Thank you for your attention,
Finally, we use the thread to solve the problem.
Solution:
loopWrapper (void * test) {void *}
CameraWrapper * a = (CameraWrapper *) test;
a-> startRec();
return null;
}setFlagWrapper (void * test) {void *}
CameraWrapper * b = (CameraWrapper *) test;
b-> setFlagFalse)
return null;
}void * CameraWrapper::setFlagFalse (void * arg) {}
exit_application = false;
fprintf (stderr, "Flag changed to false\n");
return arg;
}void CameraWrapper::runLoop() {}
pthread_create (& thread_a, NULL, & loopWrapper, (void *) this);
}void CameraWrapper::runSetFlag() {}
pthread_create (& thread_b, NULL, & setFlagWrapper, (void *) this); -
Problems when creating extension using pim contact webworks API
Hello
I need to create an extension that use webworks APIs to get all contact data as well as launch the contact selector and must obtain the name of the contact, numbers and Base 64 of contact image chain.
Now, I have a few quesries below:
1. I tried to reach my api requirement with webworks. For this, I did changes in the config.xml file.
<>ermissions >
<>Ermit > access_pimdomain_contactsermit >
ermissions >and able to access the API of pim.contact placed here: C:\Program Research In Motion\BlackBerry 10 WebWorks SDK 1.0.4.11\Framework\ext\pim.contacts
But when I tried to get all contacts by using the getContactAccounts() method, it gives me two accounts simcontacts and LocalContacts and their identity papers are respectively 2 and 19.
I found that I can get the list of contacts using the example of the contacts. but this is to limit the length to 20.
2.i have not found any documentaion appropriate for the fields of my contact: name, numbers and Base 64 of contact image chain like the way they gave in the native SDK documentation.
Please share any code example that is in all fields of contact data of Singla retrieving.
3. I need to share my contact plugin and need to expose certain methods of my plugin webworks.
How can I reach it?
Is it possible to get the code side native for pim.contact plugin, so that I can add methods more in it and can expose these methods more Web app works by making the required in index.js and client.js chnages.
Help, please.
I checked and there seems to be a problem with the API that has been fixed for version Gold SDK. Here you can find a similar position:
http://supportforums.BlackBerry.com/T5/Web-and-WebWorks-development/need-help-with-BB10-WebWorks-con...And more information on the real fix here:
https://github.com/BlackBerry/Cordova-BlackBerry-plugins/pull/80It seems that it was default 0, which gave 20 results, as opposed to-1, the expected default value.
For now, if you simply pass a high value for limit, which should get the contacts (i.e. 1000). I know that's not ideal, but a workaround for now.
For plugins, the best starting point would be the following.
WebWorks SDK 1.0:
https://github.com/BlackBerry/WebWorks-community-APIs/tree/master/BB10/templateWebWorks SDK 2.0:
https://github.com/BlackBerry/WebWorks-community-APIs/tree/master/BB10-Cordova/template -
[BB10 - Extension Webworks - link to Qt and Cascades library]
Hello everyone (and RIM - Research In Motion - QNX Mometics - Qt).
I want to add an environment variable CONFIG += qt warn_on debug_and_release stunts for my extension, what do I do?
And I want to add the file *.pro for my extension project, what should I do?
Best regards
Dennis Ritchie.
My extension uses the same thing you are trying to do
There are a few hoops you have to jump through when writing extensions, but once past that they is not difficult
If you gimme an idea of what you are after using I can help properly
The simple rule is not Visual in the extension
-
[Linker for Extension Webworks]
Hi all
Can I use a library Qt and Cascades for Webworks Extension [BB10]?
Best regards
Dennis Ritchie.
QT: Yes, for the basic things. Waterfalls at the moment: No.
See the DeviceInfo Extension for an example of one that connects against QtCore:
https://github.com/BlackBerry/WebWorks-community-APIs/tree/master/BB10/deviceInfo
Us also work on a model example that would use more Qt code, which seeks to support the things more advanced who is inspired by stunts. We have only done some preliminary research up to now:
https://github.com/BlackBerry/WebWorks-community-APIs/issues/166
-
How to handle shared extension webworks reference library
My webworks extension uses a shared reference library. The library module is deployed with an agent java application on the device already. In case of native java application, other applications that use this library shared do not overload the library during deployment.
In the case of webworks app, seems that I have to put the library jar file in the root of the webworks app to be able to compile the web extension to bbwp command. However, after I deployed the cod file, I get prompt the class in the library has been defined in several.
Is there a way to not wrap the library with the webworks app file?
June
I got response source RIM on another thread of e-mail and it workd form me. I post the answer here to share.
The recommended method for distributing webworks extension is to copy the source in the ext of the webworks SDK folder. This will allow you to use a single code base across multiple use of a same extension. How to distinguish a pot for the inclusion of a compile-time only jar is with an additional label in the library.xml for dependencies.
sample: bbm webwork extension:
blackberry.bbm.platform.BBMPlatformExtension June
-
Create a QImage bb::cascades:Image
Hi, how can we create a QImage from bb::cascades:Image or bb::cascades:ImageData?
Thank you
Sorry to bring this element thead dead to life, but you can easily extract data from bb::ImageData using bb::utility:ImageConverter :
bb::ImageData imageData; // our source imageDataQByteArray encoded = bb::utility::ImageConverter::encode("image/bmp", imageData);QImage image; // destination QImage if (image.loadFromData(encoded, "BMP")) { // load QImage from encoded QByteArray as BMP streamQImage scaledImage = image.scaled(720, 720, Qt::KeepAspectRatio); // if we wish to scale source image scaledImage.save("sample.png", "PNG"); // if we wish to save scaled image}
-
Creating a file with cascades bar
Hi all
I developed an application for BB10, tested on the Simulator. Now, I want to create a file bar so that I can install it on a device BB10.
I regieterd and got the SJC files.
Need steps on how to package the application.
I built the device-release code, I can see the arm with .so files folder, but cannot find a bar file.
I can't connect the device and run through the IDE (the device is not available), so need to how to create a bar of gall I can send it to the test.
Right click on the project-> export-> BlackBerry-> Release Build
-
How to create multi level (dependent) cascading list of values using ADF
Hello
In my project dependent Lov is necessary. I mean, for example, if two fields COUNTRY and STATE are there.
Requirment is like this:- The field of all countries be lov. On the other hand, all by selecting the country of country lov, any State should display corresponding to this company in the area of the STATE.
Kindly help.
Thanks in advance!
Janet,
Is not what you want?
https://blogs.Oracle.com/aramamoo/entry/how_to_create_multi_level
https://oralublog.WordPress.com/2013/08/05/ADF-tutorial-how-to-implement-dependent-list-of-values/
See you soon
AJ
-
NAPP Watermark Creator 1.0.7 will not work on PS CS5. Tool panel appears clearly for 1 second, but then fuzzy and will not work.
Any ideas?
PS CS5 watermark Panel is here http://www.russellbrown.com/scripts.html
I don't have any use of watermarks, so I have not tried.
-
Sorry, new developer to waterfall
is there any document on via http access json data?
I found a few cpp files when creating extensions webworks but do not know how to use it.
Thank you
You can use the class JsonDataAccess, QVariantList, QVariantMap, QVariant access JSON file structure: https://developer.blackberry.com/native/documentation/cascades/device_platform/data_access/working_w...
Once you set your JSON to QVariantList, there are a lot of discussions in this forum who have excellent explanations on how to access the child elements and properties.
-
creating applications with service headless webworks
I created an application with some headless webworks by following this tutorial:
https://developer.BlackBerry.com/HTML5/documentation/v2_1/creating_a_ww_app_with_headless_app.html
but after having imported the native extension (service without head) in momentics IDE. When I tried to build the project, I got this error:
No rule for target "device-Debug". Stop.
just for the record, when I try to create a new extention webworks, everything is ok and I can build my extension. However, I can build the project imported native extension Webworks.
Is there something I missed upward?
No it's not something that you screwed up - it is a bug in the SDK. The Makefile that comes with the SDK is removed somehow so you can not build the native part.
The WebWorks team is already is studying and working on a fix for it.
Meanwhile, Don Turner provided a work around in the comments on this tutorial page.
Maybe you are looking for
-
Mail for Mac OS Sierra missing attachments
In many of my emails, attachments are missing. I have about 10 imap and pop3 accounts in my mac mail. I use this for work and get 50-100 emails with attachment of accounts per day. I know it's a bug, but someone already have a practical solution unti
-
How to use the utility disk first aid for hard drive internal el captian
How to use the utility disk first aid for hard drive internal el captian
-
Binary indicator for digital output device
This probably simple question for most people, but there is always a first time to do a new thing/thing we have ever done. I NI 9472, which is a digital device of the supply, I have no problem to control using LABView to produce the result (line 0000
-
Lost child when loading dyncamically parent class data
Hello everyone. I have a 'View' parent class that has some private data, for example (String) ' name' and 'VI refnum' (refnum). A 'View' is "unique Graph", a "_Display.vi".vi is a simple graphical view, I will later put in a secondary. The class also
-
Blue screen of Smartphones from blackBerry on Z10 during startup