How to open link in webview in Blackberry like iPhone and Android ?
Which should not be open in Browser ,it should be opening in Webview through application .
The Blackberry equivalent of a WebView is a BrowserField. Example code from this page:
import net.rim.device.api.browser.field2.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.container.*;
public class BrowserFieldDemo extends UiApplication
{
public static void main(String[] args)
{
BrowserFieldDemo app = new BrowserFieldDemo();
app.enterEventDispatcher();
}
public BrowserFieldDemo()
{
pushScreen(new BrowserFieldDemoScreen());
}
}
class BrowserFieldDemoScreen extends MainScreen
{
public BrowserFieldDemoScreen()
{
BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig();
myBrowserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,BrowserFieldConfig.NAVIGATION_MODE_POINTER);
BrowserField browserField = new BrowserField(myBrowserFieldConfig);
add(browserField);
browserField.requestContent("http://www.blackberry.com");
}
}
Options Icon -> Host Routing Tables -> Register Now
If the above instructions failed, try stepping through these instructions one by one
* Try getting your service books retransmitted.
a. Login to your BlackBerry Web Client (BWC/BIS) site.
b. Click "Profiles" (At the top of your BWC webpage via your PC)
c. Click "Send Internet Browser Service Book"
* Try rebooting your BlackBerry by removing and reinserting battery.
* Make sure you are running BlackBerryOS 4.0 by checking:
Check Options -> About
If you are not running at least Version 4.0, you need to download and install BlackBerryOS 4.0 then repeating all the above instructions again.
* If that does not work, and you are on a BlackBerry Enterprise Server (BES), try re-activating your BlackBerry on BES. This may be as simple as connecting your BlackBerry to your PC and synchronizing your BlackBerry while Outlook is in ONLINE mode.
I think that you are looking for the BrowserField UI component.
Related
I am developing an app for radio streaming using exoplayer library. So, I want to clear(delete) exoplayer notification bar (with play/stop buttons) when I close the app(from recent apps e.t.c). Now, I close the app but the notification bar still appears and doesn't close with swipe left/right.
I tried the following source code but it doesn't work (i tried to run the lines of the source code separately from the methods but I can't solve the problem).
public class RadioService extends Service {
......
.......
......
public void onTaskRemoved(Intent rootIntent) {
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.cancel(NOTIFICATION_ID);
stopForeground(true);
notificationManager.cancelAll();
}
public void onDestroy() {
super.onDestroy();
stopForeground(true);
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.cancel(NOTIFICATION_ID);
}
}
I declared it in AndroidManifest.xml too.
Any help please?
Check this answer How to kill a foreground service along with the application and an example
https://androidwave.com/foreground-service-android-example/
at android 8 and above you have to use foreground service.
Add a small delay after the clear of notification and before killing the app or create a function that will inform you the notification is cleared
I'm developing windows 10 UWP app. I need to collapse system tray only for Windows 10 Mobile app.
Finally I got answer
var statusbar = "Windows.UI.ViewManagement.StatusBar";
if (ApiInformation.IsTypePresent(statusbar))
{
//await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ShowAsync();
await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();
}
Note: Don't forget to add windows phone extention before using above code
Fore more Info:
https://msdn.microsoft.com/en-us/library/windows/apps/Dn609832.aspx
I find the way that can help you! u should use this code in the public MainPage() class
ApplicationView.GetForCurrentView().TryEnterFullScreenMode();
this code hides the status bar and make ur app full screen in phone
So - I want to make a windows phone app that links to my webpage when I open it - how do i do that? I have the SDK, and tried with the browser, but I can't seem to find anyway to set a homepage?
You could use the WebBrowser control, placing it on an otherwise empty page. This may allow you to fine tune the experience if wish.
But what would be even easier is to just use the WebBrowserTask. This would launch you right back out of your app and into OS's true browser experience. In the App.xaml.cs file, just add the following code:
private void PhoneApplicationService_Launching(object sender, LaunchingEventArgs e)
{
WebBrowserTask webBrowserTask = new WebBrowserTask();
webBrowserTask.Uri = new Uri("http://my.superawesomewebsite.com", UriKind.Absolute);
webBrowserTask.Show();
}
You app will immediately launch the browser an you don't have to do anything else.
I am using Javafx and FXML . I have created my form . in one of my pages I have a Tree in the left pane (Split Pane) , and the right pain is a Webview inside the right Anchor pane.
when I select a node on the tree (treeItem) the webview will change accordingly to the respective site that was selected in the tree view.
This works (like a charm)when I run it as an application.
HOWEVER , when viewing this in the browser (i.e. chrome , firefox and safari(mac)) i dont see the web view , it stays blank. i.e. the UI will load and the tree will be there , but the right jand pain never shows the embedded views.
When I run as a webstart I see the right views. The web pages that are embedded into the web views have a login, when i try login the web page flicker , like ther refresh and the login form is blanked, I have to enter the credential again.
not sure what is wrong or how to debug the browser / webstart side.
when viewing this in the browser (i.e. chrome , firefox and safari(mac)) i dont see the web view , it stays blank. i.e. the UI will load and the tree will be there , but the right jand pain never shows the embedded views.
If you not done so already, you will need to sign your application to allow it to run outside of the browser embedded Java application sandbox so that the webview's network layer has permission to access the external locations.
Also monitor the webview loadworker's exception property to see if an exception or FAILED state was encountered:
Worker worker = webview.getEngine().getLoadWorker();
worker.stateProperty().addListener(new ChangeListener<Worker.State>() {
#Override public void changed(ObservableValue<? extends Worker.State> observableValue, Worker.State oldState, Worker.State newState) {
System.out.println("Browser state change: " + newState);
}
});
worker.exceptionProperty().addListener(new ChangeListener<Throwable>() {
#Override public void changed(ObservableValue<? extends Throwable> observableValue, Throwable oldThrowable, Throwable newThrowable) {
System.out.println("Browser encountered a load exception: " + newThrowable);
}
});
not sure what is wrong or how to debug the browser / webstart side.
There is an excellent Oracle article on debugging steps for webstart / browser embedded applications. The article provides numerous pointers such as how to set debug and trace levels, etc.
i try to open web browser apk, open one web page.
is it possible to ZOOM IN/OUT of this web page using robotium ?
and i try to open one docx file using open Office apk automation using robotium.
is it possible to ZOOM IN/OUT for this document page using robotium ?
Any one have solution then please help me.
As far i know there is no functionality like that in Robotium.
For a web page you can use the zoomIn() method of a webview that you have gotten a reference to using any number of the ways you can with robotium.
To be able to use this method you will have to cast the view you got from robotium to a WebView and to perform the zoom you will have to run on the uithread. The code would look something like:
final WebView webView = (WebView) Solo.getView(R.id.web_views_id);
instrumentation.runOnMainSync(new Runnable() {
#Override
public void run() {
webView.zoomIn()
}
});