How can you detect the native browser shutdown in a Blackberry app? - blackberry

I've got a Blackberry app (5.0 and above) that I'm making changes to. One feature of the app launches an online banking function in a BrowserField2. I'm investigating a change to the app that would have the online banking function launch in the native browser, using this basic function:
Browser.getDefaultSession().displayPage(myBankingUrl);
The change is mostly motivated by performance -- the BrowserField2 seems a lot slower than the external browser.
My show-stoppper is this: in the existing implementation, I can detect when the BrowserField2 screen is shut down, and I can force the invocation of a logout call. The bank that's associated with the online banking function really really cares about this. I have not yet found any way to hook in to the shutdown of the external browser to port over this piece of functionality. Has anyone tried something like this?

There is no API to detect that. You can listen when your app is activated - if you open browser your app screen is second in stack and becomes first when user closes first. But there is no garante that user will close browser or move to another app (to view incoming sms for example).
I would suggest you to continue with BrowserField2 for 5.0+.

The browser on a BlackBerry is always running. It provides the default push service reception and other required services.

Related

How to remote desktop to an iOS device, a.k.a. how do Mobile Device Farms work?

I have been trying to understand how Mobile Device Farms like DeviceConnect, AWS Device Farm, SauceLabs, etc. get to remote control iOS devices, but I can't find anything on the subject. They get to do it without jailbreaking, which baffles me even more.
I love these kind of projects, because at the moment it seems undoable, but I know that it is possible ('they' are doing it).
With remote control I mean: seeing the screen of the iOS device on your computer screen and able to touch and swipe with your mouse.
Can someone please point me in the right direction as to how these technically work?
If you're using an iPad (in particular) or an iPhone (if you think you'll be able to make our any detail on the smaller screen) then using remote access to view and control what's on your friend's Mac is a good option. And the best way to remote-access a Mac from an iPad is to use Google's free Chrome Remote Access service, which lets you remotely use Mac programs from an iOS device.
It's quite an involved process to set it up the first time, but easy if you want to do it again in future. You'll need the Google Chrome web browser for Mac, and a Google account.
Here is link for Chrome Remote access
https://chrome.google.com/webstore/detail/chrome-remote-desktop/gbchcmhmhahfdphkhkmpfmihenigjmpp?hl=en
Open Chrome and go to Chrome Remote Desktop on the Chrome Webstore. Click Add to Chrome, then Add App. Click Allow, then Continue.
I will give you one approach and small explanation .
You will need to create application with all possible permissions at first also implementation handlers functions .
For example :
Works with files
Real native Socket connections (not http protocol) + need to have some main server signalling (domain or static ip).
Handle remote touch trigger (main problem for real remote/iOS)
Background part experience
Your app need to be non-Market app (more likely).
You can make Application with all possible options that apple give us.
What can you do remote with your app : -control camera/ Mic read geo data , work with galleries , delete or create files . Socket will be communication line .
Also app must initially started and make (on user request) always allow all permissions .
Use camera :
Send with socket some command example ( openCamera ) . AFTER receive this string perform action for opening camera .
If you can fix programability triggering touch events you can make remoteIOS.
More data links :
Q/A send remote events
Q about touch events
Q/A about Permisions
Sorry for the first quick answer,
All of these: DeviceConnect, AWS Device Farm, SauceLabs use Appium in order to control devices.
The component that execute the command is the WebDriver.
Appium have different WebDriver implementation in order to execute operations to different device.
The iOS WebDriver can be found here: https://github.com/appium/appium-ios-driver.
The protocol in use is the JsonWireProtocol.
more details can be found here:
http://appium.io/,
http://www.seleniumhq.org/
Regards

AppStore: will app relying on network be approved?

I develop a well-looking professionally designed application, which loads events for some clubs at startup (it has more functionality, but all require network connection).
If there's no internet access, app shows "Error: No network access" message with OK button. It exits when user presses this button.
Will it be accepted in App Store? If no, what should I change?
Thanks! :)
This is an opinion question, but my experiences suggest:
It's OK that your app requires network access to provide meaningful content.
Do NOT forcibly terminate (exit) your app in this case, but instead show a helpful message, and keep polling the network status (ie use something like Reachability). If and when the network connectivity comes back, remove the message and proceed.
Bonus points: If you can cache data from when there is a connection, then you can run the app anyway showing the most recent data you have. This is generally preferable as a user experience to simply blocking access to the UI if you can't get to the internet.
Do not exit the application.
If your app work only if network is available, that's okay. But if network is not there, it would be better if you show an empty view with proper message (That for this app, network is needed or something like that. Add some error images or graphics it'll improve the user experience also). Don't forcefully close the app, it can be consider as a crash(Apple will reject your app).

Another Stand Alone Web App Linking Issue

I have a mobile web app designed as a single place for employees of our company to help them locate various online resources. The app has a lot of in-app content, but also provides links to external partner websites. My issue is a common one with a bit of a twist. I like the way the app looks in standalone mode on an iphone, but am struggling to figure out a solution for keeping the app in stand-alone mode, while also providing the ability to open external links in safari. I know how to keep the app in standalone mode when links are clicked, but when an external link is clicked, one of two problems occurs:
1) If I code the external link to keep it in standalone mode, there is no way to navigate back to my app from the external site as the back button is obviously no longer available.
2) If I code the external link to open in safari, when the user is done with the external link, the session for my app is closed and the user has to go back to their homescreen and re-open it again. (I know I can code it so that they will return to where they were in the session, but this is not the solution I want).
My question is this, is there a way to open external links ON TOP OF a standalone web app session? So that when the external link is closed, the standalone web app session appears?
I've read that I can use AJAX to open external links within the active session, but I don't know how to do this and can't find anything online that explains it well. Any help would be MUCH appreciated.
My app functions fine in safari, but looks SO much better in standalone mode; I would be SO appreciative if anyone can provide a solution. I am also willing to discuss paying someone to help with this as well.
Cheers,
SC
Turn your app into an actual app, not just a web site. You should implement your own web browser in your app using UIWebView. It's very simple. You probably only need a back button and a close button, you don't need a full search/address bar, bookmarks, etc. UIWebView and two buttons will do it.
As soon as you switch apps to Safari you will see the behavior you have described - there's no getting around it. Your only choice is not to exit.
https://developer.apple.com/library/ios/documentation/uikit/reference/UIWebView_Class/Reference/Reference.html

Cordova - opening the InAppBrowser without checking for a network connection (Apple Approval)

I'm not entirely sure why I feel this way, perhaps something I read at some point, but my understanding is that while providing an offline experience within an app, it is my responsibility to appropriately manage situations where my app requires an internet connection and one is not available (a proper alert for example).
When opening an external website using the Cordova InAppBrowser, if there is no internet connection, am i required to do something about it, or is the error appearing in the webview of the plugin enough? Will this interfere with the approval process, or is this entirely ok?
Check this out Dom.
http://gtproductions.net/blog/ways-to-get-rejected-by-apple-app-store-tips/
point 4 seems to point out that apps (games here) may get rejected if connection issues are not properly handled.

On blackberry : making a phonecall within an app on user action without J2ME?

Is there a way of making a phonecall within an application using Browser application development ? (for example using a link with a protocol similar to 'mailto:user#example.com' but that would make phonecalls instead of sending mails.)
If not, is it possible to make phonecalls using the Rapid application development ?
If this an app hosted in a browser, Blackberry respects WAP conventions for encoding a phone number.
Here's an example snipppit for displaying a number that is callable via a Blackberry device:
<a href='wtai://wp/mc;5551231367' title='Call'>555.123.1367</a>
I've been using this approch for some time now and it works for me. When the user clicks the link, a dialog from the OS pops up and asks if you would like to call this number.
Additional Information
I also recommend checking out Blackberry's additional resources on development. Since the current browser is still in the stone age compared to iPhone/Android it's worth seeing what's possible.
http://na.blackberry.com/eng/support/docs/subcategories/?userType=21&category=BlackBerry+Browser

Resources