Issue with FilePicker in BlackBerry 10 - blackberry-10

I've being trying to implement a native File picker on BlackBerry 10 today, I linked it against the required Library -lbbcascadespickers
Included <bb/cascades/pickers/FilePicker> that links to the FilePicker.hpp class and all seems fine, but when I try to create a new File picker it says "error: 'FilePicker' was not declared in this scope"
Code is as follows:
FilePicker* filePicker = new FilePicker();
filePicker->setType(FileType::Picture);
filePicker->setTitle("Select Picture");
filePicker->setMode(FilePickerMode::Picker);
filePicker->open();
// Connect the fileSelected() signal with the slot.
QObject::connect(filePicker,
SIGNAL(fileSelected(const QStringList&)),
this,
SLOT(onFileSelected(const QStringList&)));
// Connect the canceled() signal with the slot.
QObject::connect(filePicker,
SIGNAL(canceled()),
this,
SLOT(onCanceled()));
I'm brand new to BlackBerry development so don't really know what to do, I've cleaned the project and built it many times but it won't play.
I was going by the example on BlackBerry's website:
https://developer.blackberry.com/native/reference/cascades/bb_cascades_pickers__filepicker.html
I wanted to open it from QML (I'm using Qt Quick and not BB components)
If anyone can help it will be deeply appreciated

The compiler can't find FilePicker. So either use a using to tell the compiler where to look:
using namespace bb::cascades::pickers;
or fully qualify the name of the class:
bb::cascades::pickers::FilePicker* filePicker = new FilePicker();

Related

Google App Engine (GAE) WEB-INF/lib order

Hey guys i'm working on a project with Google App Engine. To get Data from my devices we're using MQTT. The org.eclipse.paho.client.mqttv3.* library starts a Thread with "client.connect()".
After some researches i found that you cant just simply create Threads when working with GAE. Following error is shown:
java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup")
So i continued searching and someone told to use following code instead of a "normal" Thread:
Thread monitoringThread = ThreadManager.createThreadForCurrentRequest( new Runnable() {..}
So i decompiled the paho library, looked up where the Thread is created and changed it.
I created a new class exported it as mymqttclient.jar
In eclipse i changed the order of my build at Properties -> Java Build Path -> Order and Export so mymqttclient.jar is loaded before the mqtt-client-0.4.0.jar So that it will use my created function with the monitoringThread.
But how can i change the order of the .jar's in the web-inf/lib ?
Thank you very much for your answers, i couldnt find something useful until now.
Firstly there is no need to decompile any of the Paho code it is all available from here.
Since you can now get the clean source, why not just modify the original class and rebuild the jar file, then you don't need to worry about messing with the Classpath to get your class to load first?

I need help on accessing address book in Flash Builder 4.6 - Win 7

Hey guys so I am trying to dev a app for IPhone and am very very stumped right now. I have tried using Contact Editor - ANE (http://extensionsforair.com/extensions/contact-editor/#comment-7488) but I get an error:
VerifyError: Error #1014: Class pl.mllr.extensions.contactEditor::ContactEditor could not be found.
at runtime::ContentPlayer/loadInitialContent()
at runtime::ContentPlayer/playRawContent()
at runtime::ContentPlayer/playContent()
at runtime::AppRunner/run()
at ADLAppEntry/run()
at global/runtime::ADLEntry()
I made sure I included the correct file path under the ActionScript Build Path, besides that I don't know what else I can do. I do get the function like ContactsSimpe() function that hints when looking for a function. So I know it is connecting but once I go to compile and test in the flash pro I get this error. Here is some code that may help:
code....
import pl.mllr.extensions.contactEditor.ContactEditor;
public class soscode extends MovieClip {
var contactEditor:ContactEditor;
public function soscode() {
stop();
init();
contactEditor.getContacts();
}
code...
in my project window on left the .swc file for the native extension is in the reference folder. That is about it.
I really need some help on this an if you could give me a hand I would much appreciate it!
David,
Please let me know if you need anything else.
I'm guessing this might be a bit late now, but I've just been having this problem myself, and it was caused by the ANE not being packaged with the app when it's sent to the device / simulator.
Classes within the NE weren't being found at runtime, but were accessible in Flash Builder.
It turned out that by default the .ANE file wasn't copied to the device.
To fix this, change the following project property:
ActionScript Build Packaging -> Apple iOS -> Native Extensions -> Check 'Package' for the ANE
No idea why it wasn't included by default. When you uncheck 'Package' you get a warning telling you that it may cause runtime issues!
Hope this is of use for somebody.

How can I do Junit tests for Google Maps in Android?

I am using the Google Maps API in an Android project and now I need to test it using JUnit if possible. (I am somewhat new to both JUnit and Google Maps.) I have been scouring the internet but was unable to find anything.
The map view has dots/pins for stations and when I tap one I get a balloon popup with the name and other info. Then when I tap the balloon I get a new view with information about the location and actions to perform such as navigate.
What I want to know is, is it possible to write a JUnit test case that finds all these dots/pins, taps them, and verifies information on the new view that pops up? Additionally, I would like to change/mock the location that the GPS has and see what happens if I try to, say navigate overseas or something like that.
I do have a list view of the same locations which I will test as well, but I would like to know if there is a way to test the map view.
I would prefer an automated test script like what JUnit provides. If this is not possible with JUnit what is the best alternative?
I am working with Android 4.0 and using Eclipse.
Any help would be greatly appreciated.
In case anyone wants to know after much searching I finally found something that can test Google Maps. Things such as zoom level and I believe tap pin (method is called tapMapMarkerItem()) are supported. I have not tested the pin tap yet tho.
Apparently the awesome Robotium does not support map testing by itself. Nicholas Albion was nice enough to create an extension to provides testing support for maps on Android. Thank you so much Nicholas!
So here it is:
1. Download the Robotium jars from robotium.org (I found this helpful http://www.vogella.com/articles/AndroidTesting/article.html - by Lars Vogel)
2. Download the extension from https://github.com/nalbion/robotium-maps

iOS Application framework

I have created an ios application that can talk to the database and get the messages from the server and all i want to do now is to distribute this aplication as a templet and other application can import my current project and use it, Now i been went throw many tricks and tips such as making an Static framwork using xcode bundles and Aggregate target type and got it work with some script found hear: http://codefriend.blogspot.com.au/2011/09/creating-ios-framework-with-xcode4.html
what i want to know is whether its the correct approach for such a problem or should i been looking at something else. All i want to create is an framework for my team so that they can produce other application
without worrying about or writing same files and code again and again. And is it possible to bundle all the .xib and .html files too?
This is what we use to create framework:
https://github.com/kstenerud/iOS-Universal-Framework

Create an App within an App

I am being presented with a very interesting project. The task that I must complete is to figure out a way to allow a partner to be involved in an app without giving up their source code. The code will be included in the main bundle of the app so it is not dynamically stored. The partner has a fully functional app that is needed to be ran in a window within the main app at the appropriate time. I know having the partners create a web app would be ideal so it is treated like a webpage but I am more concerned with codes that must be written natively in iOS.
My question is what is the best way to go about solving this? In theory it is like an App within an App. Is there a way if they gave up their .app file I can include this in the bundle and then run it when I catch a certain event? Should I have the partners create their code in a framework and then import into the shell project? What is the best way to approach this problem?
If your 2nd-party doesn't want to provide you with the source code, why doesn't he compile it to object code then let you simply link it to your app?
By the way, at least on official (non-jailbroken) iDevices, apps can't 'embed' or 'open' one another in such a way - you can open an app programmatically if 1. it's a separate app 2. it has a registered special URL associated to its bundle.
Is there a way if they gave up their .app file I can include this in
the bundle and then run it when I catch a certain event?
No, you'll want to have them create a library instead. You can then include that library in your project.
Creating a library is as simple as:
Choose File->New...->Project... in Xcode.
Select the "Cocoa Touch Static Library" project template.
Add your code.
Build.
The result is a static library that you can add to your application(s). The library will contain the compiled code that you added, but doesn't include the source code. The library developer should provide whatever header files are necessary to use the code in the library.
An App within an App is possible however it requires a common data framework that allows one app to reference the same data without confusing the the source of and destination of the data.
Such a framework allows one app to interact with another app referencing the same data.