Possible to create a Blackberry portal app to a website? - blackberry

I have a mobile website special for the blackberry. I would like to create a blackberry application that just displays the mobile website. Like a portal. I need same features as a web browser but accessable as a blackberry desktop icon and downloadable in the blackberry store.
I never created a blackberry application before and i just want to know if this is easily possible.

This Functionality is call Blackberry web-icon. you can create web icon as following sample code.
import net.rim.blackberry.api.browser.Browser;
import net.rim.blackberry.api.browser.BrowserSession;
import net.rim.device.api.ui.UiApplication;
public class simpleshortcut extends UiApplication {
public static void main(String[] args){
simpleshortcut instance = new simpleshortcut();
instance.enterEventDispatcher();
}
public simpleshortcut() {
BrowserSession site = Browser.getDefaultSession();
site.displayPage("http://websitelink.com");
System.exit(0);
}
}

Related

Flutter iOS text strings sharing between 2 Flutter applications

I have been looking for a way of sharing text strings between 2 Flutter apps I'm working on.
After days of research I was able to share a piece of text between the two apps using the share official plugin on the sharing app side and using Intent filter receiving text/plain for the Android platform. I have been trying to solve it on iOS since then.
There are 2 main problems
App A wants to share a piece of string data so app B has to show up in the options of receiving that data, here my app was not among the options.
If the data is shared with the app B, how will the app B handle the incoming data.
I have already tried several options :
I. URLLauncher plugin official plugin couldn't open custom URL Scheme other than the web, sms stuffs,
II. The share plugin on iOS couldn't show my app among options of receiving text apps . I didn't find docs on how to make my app appear as a receiver of text shared by other apps and how to handle the incoming text in the receiver app.
To show your iOS app in the options of where you want to share it, you can use the plugin uni_links which works on both Android and iOS. You can define a custom scheme which then triggers your app.
Set everything up then create a listener:
import 'dart:async';
import 'dart:io';
import 'package:uni_links/uni_links.dart';
StreamSubscription _sub;
Future<Null> initUniLinks() async {
// Attach a listener to the stream
_sub = getLinksStream().listen((String link) {
// Parse the link and warn the user, if it is not correct
}, onError: (err) {
// Handle exception by warning the user their action did not succeed
});
// NOTE: Don't forget to call
_sub.cancel() in dispose() }

How to open blackberry native browser from browse field app for external link

I am working on an app for blackberry(jre 6.o & os 7.x) using browse field and app is working fine. One thing I want that, when click on a link in app and link url(domain) is different from the url which is invoked in app using browse field, open link in native blackberry browser. Please help me how to do this. Thanks.
You can extend ProtocolController class and override its handleNavigationRequest() method to do a custom implementation.
usage-
oBrowserField.getConfig().setProperty(BrowserFieldConfig.CONTROLLER,
new CustomProtocolController(oBrowserField));
Where oBrowserField is BrowserField instance
And CustomProtocolController is custom class extending ProtocolController

How to target mobile devices to a project

I got solution now in Visual Studio with 2 web projects. One default, and one i would like to target if the user is using a mobile device.
I would like to check if the user is on a mobile device when entering the default site, www.site.com, then redirect to the m.site.com.
How can this be done?
[1]
In ASP.NET, you can easily detect the mobile device request using Request.Browser.IsMobileDevice property and Request.UserAgent.
The following code checks the IsMobileDevice property and redirects to the mobile specific page:
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Browser.IsMobileDevice)
{
Response.Redirec("~/default_mobile.aspx");
}
}
[2]
Another better method is to use open source project called 51Degrees. Here is an article about how to use it in your application.

How to launch AppWorld from an application? [BlackBerry]

This might be a easy question but i couldn't find solution. I want to open AppWorld by clicking a button in my BB application. For example when user clicks this button Appworld will show "Facebook Application" page. Can i do this?
In Android platform this line launches GooglePlay for Facebook App. Does BlackBerry supports this kind of method?
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.facebook.katana")));
Here is a simple way to do this:
Browser.getDefaultSession().displayPage("http://appworld.blackberry.com/webstore/content/2360/?lang=en");
Above code will invoke the browser in the application and open the BlackBerry App World, I tested it in device and it's perfectly working. For now I put a Whats App messenger link, but you can customize the link according to your requirement.
You can open App World from your BB application directly using the following code. This code avoids opening the browser first.
Registry registry = Registry.getRegistry(this.getClass().getName());
Invocation invocation = new Invocation(null, null,
"net.rim.bb.appworld.Content",
false, ContentHandler.ACTION_OPEN);
invocation.setArgs(new String[] { /* app id in appworld */ });
registry.invoke(invocation);

BlackBerry can you call up the web browser from java?

I’m writing a app for the blackberry and would like to call up the built in browser, can you do this?
If you are building a Midlet, use the platformRequest method to do this.
If you are building a blackberry app, you can use:
BrowserSession browser = Browser.getDefaultSession();
browser.displayPage(url);

Resources