was wondering if there was a way to build an application that its screens can be called from another application and values can be passed back and forth between the two apps, taking a cull from the Invoke API
the link http://supportforums.blackberry.com/t5/Java-Development/Launch-a-third-party-application-from-another-third-party/ta-p/444753
just shows how to launch one application from another, however i want to launch a specific screen in a separate application and get results from it into the calling application.
You can use an IPC mechanism available in Blackberry, using Global Events. Check the following link : How to communicate with other applications
In short, two applications A and B can communicate by defining an unique id (long) to identify the messages destined to each other. Once this id is defined in both the applications,
To send a message from application A, use postGlobalEvent
To receive messages from application B implement GlobalEventListener.
Complete example is shown here
Related
I have a requirement where I download an invoice in App A. I have a printing App B. The invoice in App A needs to be printed using App B. Is there a way I can achieve this using swift ios?
Both App A and App B belongs to the same development team.
You can not directly call another applications functions however you can launch the other application using a URL scheme (Create a URL scheme to handle printing invoices and the routing required if launched via the scheme) and pass the required information for the invoice to be printed.
I am working on a POC iOS application that will eventually be released through an internal enterprise MDM solution. The app itself is pretty straightforward. It makes a quick call to an internal endpoint to return some simple json and then displays it on screen. At the same time, I have an app extension (Today Widget) displaying a small fraction of that data as well.
I have created a shared framework that includes the service calls, as well as any other common code I am using. Unfortunately, the parent app and extension all work perfectly fine if I'm on the internal network where the service endpoints live. However, this app will not always be on our trusted, internal network. As a result, we wrap the build with a secure container provided by our MDM solution and open up traffic to our specific internal endpoints. This works perfectly fine for the app, but our MDM provider doesn't currently provide similar capabilities for App Extensions.
As a result, I am working to come up with creative ways to best ensure the data in my Today Widget is up to date without it directly making a service call. To do so, I am sharing data between the app and extension via an app group, but if the service call is only made from the parent app and the user very rarely accesses the parent app, the data will still be out of date.
In order to simulate making the service call from the app extension to update the data, I would like a way to call the service on behalf of the parent app, which would then update the NSUserDefaults data being shared between app and extension.
So my question: What is the best way for me to initiate that service call in the parent app? Is it even possible? I know Apple provides the 'openURL' method to allow an extension to open it's parent app, but I don't want to actually open the app. I want the app to be running in the background while the extension makes the service call on it's behalf.
I have been looking into the following, but with not much luck:
Parent app has an observer on NSUserDefaults, watching a specific key, that when modified by the app extension will fire off the service call to update the shared data being displayed. Unfortunately, I don't believe this will work, since as long as the parent app is in the background, the NSUserDefaultsDidChangeNotification will not get fired off in the parent app.
Send a local notification from app extension to parent app, telling it to fire off the service call and update data shared via app group. Unfortunately, UIApplication.sharedApplication() is not accessible from an app extension.
Any suggestions of ways to simulate the service call, to give my Today Widget the highest likelihood of being up-to-date with it's information?
Note: Obviously giving Today Widgets access to internal resources has it's own security concerns, but for this POC, the data is non-sensitive and must only live internally..
I'm new to iOS passbook development and I'm having trouble defining the limitations of the service. I'd rather not jump into several hours of dev work that I don't have time for without knowing it will work.
End Goal:
A user is walking to a particular location and receives a pass with their member barcode on it.
Question:
Is it possible to create this pass from my iOS app under these assumptions without any other web service or push notification involvement?
The user's barcode number is passed in via a web service after first
running the app.
The location coordinates are also sent in the same way.
There are 20+ location coordinates.
#1 and #2 are addressing the dynamic abilities of pass creation from an app. I'd like to know to what extent I can create a pass with a very specific member barcode that comes from the web services in the app itself.
#3 addresses the issue that a pass can only have 10 locations and I'm curious how to solve that issue. I suppose I could make 3 different passes (10 locations, 10 locations, X locations) but then wouldn't the user potentially have 3 passes in the passbook for what is essentially the same feature?
Apple says pass creation needs to be done on a server, not on the device. The process involves signing the pass data with your pass certificate and you should not distribute that to devices.
I don't know how to answer your #3 question.
I would like to know if I can develop an application in BB OS (4 - 7) with similar functions to Android/iOs where ;
I would be able to register the app to listen for specific URL's.
I can launch the app via URL.
I can parse data from the URL and use in the app.
For instance in Android I can use Intent Filters like this
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:scheme="http"
android:host="myapp.com"
android:pathPrefix="/launchapp/" />
</intent-filter>
to launch the app upon laoding a url such as
i can then parse the two numbers after launchapp/ and use them within the application.
Anyone experienced with BB OS know if this is possible?
I am not aware about documented listeners to intercept opened URLs. But there is GlobalEvent mechanism. Almost every step doing on pre-BB10 OS fires one or more global events. Some of them are documented, some not.
There are documented GUID's listed: http://www.blackberry.com/developers/docs/7.0.0api/index-files/index-7.html (look for G letter, and scroll down for GUID_xxxx constants).
To catch undocumented GUIDs, implement a background application, that uses GlobalEventListener. Then open a page in browser and log all global event guids and objects which come along with guids to eventOccurred call. And you can find out, which global event guids are related to url-open event. It will help to create URL interception mechanism. And this part should be a native application (written on Java).
It is possible to launch application via url, but it should be WebWorks application. Not a native one. Check this link: http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Launch-BlackBerry-WebWorks-app-via-URL-with-parameters/td-p/1674663
When your webworks application has done its part of work, it can fire GlobalEvent and your native app will wait for it to intercept it and work further.
There are some ways of doing this on BBOS depending on what exactly you want.
Create a browser plugin using the net.rim.device.api.browser.plugin API. Here you create a BrowserContentProvider and attach it to the BB browser for handling a particular mime type. This mime type must be unique to you that is not being handled by the native browser (say x-vnd-whatever/myapplauncher) . When the browser access your url, say http://myapp.com/launchapp/233, serve a file with the number 233 and the registered mime type. The browser will download the file, see its mime type and then pass the file content to your plugin for handling. Your plugin will read the app id - 233 and then do whatever you want with it. BlackBerry App World uses this method to allow developers to launch their app in app world from a url.
Create a HttpFilter. Using this, you can make connections to a given domain pass through your code. Here you will register your filter for your domain myapp.com and whenever someone tries to access any myapp.com, the browser will call your filter to handle the request. Again BlackBerry App World does this for access to http://appworld.blackberry.com domain. [There is a HttpFilterDemo in the samples to help you]
Use the StringPattern API. Almost all native text fields support it. So if there is a text field with text written that matches a particular pattern it will become underlined and clicking on it will show your custom actions in the Menu. [There is a StringPatternDemo in the samples to help you]
If your app is in App World and you just want to launch it, use the URL http://appworld.blackberry.com/webstore/content/xxxx where xxxx is your app's content id.
Moreover, there is no use trying anything with Global Events. Since OS 4.5, the global event broadcast mechanism has been partitioned in such a way that the system events are only delivered to system applications and not to their party apps and vise versa.
Hope this helps.
I am developing an app. (like google talk) which at phone boot-up starts a background service which is continuously running. This service interacts with UI (means any request to server is first sent from UI to service & from service to server) & any response is sent to UI through service.
What i know to start background service at boot up is "Create an alternate entry point and use that to start the background service. "
right click the project properties then go to Application tab, then check "Auto run on startup" / "System Module"
is it right?
In Android u can achieve this Service using system-defined Service class. How to achieve this in Blackberry 4.5? I want to do it (UI & Service) in one project.
Any solution?
Thanks for the reply.
I got a link for
"How To - Setup an alternate entry point for my application"
is it the right solution for starting Service?
I want the app. like email app. which will notify u when an incoming mail comes (like even though ur main application is minimized then also ur service is running in background which will continuously check for any incoming mail & will notify the main UI application through any app icon change)
So for this is there any class like Service class which will start at boot-up or "Setup an alternate entry point for my main UI application" is the only solution for this?
Thanks for the reply..
I read this GlobalEveltListener & tried for handling the communication between the 2 apps (Service app. & UI app.) by starting the Service at auto-startup.
I m using the "Persistent Store" & accessing it in both the apps. But the Persistent Store name should be unique otherwise it gives "Linker error: Cannot start the Service app. as Persistent Store is multiply defined." But I have to access the Persistent Store the both the apps to make some database calls.
So now i m trying for handling the Service by putting both apps in one project. So that the Persistent Store will be unique.
How to achieve this communication between Service & UI in one project?
You only need an alternate entry point if you want the program to behave in both the service mode, starting at boot and running in the background; and in application mode, having an icon in the home screen that the user can click to begin interacting with your software. In that case you need to have an entry point that tells the program "you are starting automatically at boot up", and one that tells the program "you are starting in response to user interaction".
There are other ways to handle this. If your application makes itself available to the user through ApplicationMenus, then you make the one and only entry point "Auto Run" and "System Module" so that it starts on boot, registers the menus and does not display an icon.
You can also use one entry point set to "Auto Run" but not a system module so the icon is displayed and detect the start on boot case using the ApplicationManager.inStartup() method.
The method you describe does work well for the type of application you are developing. It simplifies the initialization by allowing you to specify different arguments to the program in each entry point.
Please see the answer I have given earlier to a different question here. This essentially is an IPC mechanism between two running processes.