WebWorks: Open Web Browser? - blackberry-webworks

How do I open a web browser from a Blackberry Webworks 2.0 application?
I tried:
http://www.blackberry.com/developers/docs/webworks/api/blackberry.invoke.BrowserArguments.html
but that doesn't want to work.
Thanks

I'll answer with one of my own working config files and a <script> section
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.0.0">
<name>Webworks</name>
<author>De Wet Steynberg</author>
<feature id="blackberry.app" required="true" version="1.0.0.0"/>
<feature id="blackberry.identity" required="true" version="1.0.0.0"/>
<feature id="blackberry.invoke.BrowserArguments" required="true" version="1.0.0.0"/>
<feature id="blackberry.invoke" required="true" version="1.0.0.0"/>
<access subdomains="true" uri="http://www.somedomain.com">
<feature id="blackberry.app" required="true" version="1.0.0.0"/>
</access>
<content src="index.html"/>
<rim:loadingScreen backgroundColor="#000000" foregroundImage=""/>
<rim:navigation mode="focus"/>
</widget>
and the script tag that does the job:
<script>
var args = new blackberry.invoke.BrowserArguments('http://www.blackberry.com');
blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
</script>
Tried and tested. Perhaps create a small test example. If that doesn't work there might be something wrong with your emulator.
If you get a message moaning about permissions and such, do the following:
1) From the homescreen press the menu button
2) At the bottom go to options (The icon with the wrench)
3) Go to Applications
4) Click the menu button and select "Edit Default Properties"
5) Set everything to "Allow", Menu, Save
6) Click Menu, Edit Default Permissions again
7) Click Menu, Apply Defaults to All, answer "Yes" to the popup prompt
8) Now navigate to the "Downloads" or " Applications" section and start your app up again.
These settings sometimes seem to get lost on the emulator between restarts. As long as your app remains open you can avoid lengthy recompiles and emulator reboots though.
Hope this helps

If you are building you app for BlackBerry 10, the format of the invocation interface has changed. It now leverages the built in system invocation framework (very powerful).
Here is how you would launch the browser app using the new system:
blackberry.invoke.invoke({
target: "sys.browser",
uri: "http://www.blackberry.com"
}, onSuccess, onError);
Fortunately, there is a great working sample app already published in Github: https://github.com/blackberry/BB10-WebWorks-Samples/tree/master/invoke

Related

Can I use existing WinUI3 controls in MAUI project?

Is it possible to use the exisiting controls of WinUI 3 in the MAUI project? Like controls in https://github.com/microsoft/WinUI-Gallery
I installed the WinUI package to my MAUI project
<ItemGroup>
<PackageReference Include="Microsoft.UI.Xaml" Version="2.7.1" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.1" />
</ItemGroup>
And edit the App.xaml
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MauiWithWinui"
xmlns:controls="using:Microsoft.UI.Xaml.Controls"
x:Class="MauiWithWinui.App">
<Application.Resources>
<controls:XamlControlsResources>
<controls:XamlControlsResources.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</controls:XamlControlsResources.MergedDictionaries>
</controls:XamlControlsResources>
</Application.Resources>
</Application>
as well as Platform/Windows/App.xaml
<maui:MauiWinUIApplication
x:Class="MauiWithWinui.WinUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:maui="using:Microsoft.Maui"
xmlns:local="using:MauiWithWinui.WinUI"
xmlns:controls="using:Microsoft.UI.Xaml.Controls">
<Application.Resources>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"/>
</Application.Resources>
</maui:MauiWinUIApplication>
but when I went to use the WinUI control under a Page of MAUI, it prompted that the control could not be found
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="using:Microsoft.UI.Xaml.Controls"
x:Class="MauiWithWinui.MainPage">
<Grid>
<controls:RatingControl AutomationProperties.Name="RatingControl with placeholder" PlaceholderValue="3" />
</Grid>
</ContentPage>
the MAUI project only targeted to windows platform, though i know winui3 project is a better choice
You are mixing frameworks. If you want to use a WinUI control, you are almost right except for the last step where you are adding the WinUI control into Maui XAML.
What you need to do is create a handler that sits between the maui page and the platform view: https://github.com/mattleibow/MauiWinUIRatingControlDemo
Th reason this is needed is that this code will also run on Android, so that needs to also do something. If you try build your code for Android now, it is impossible to even compile. MAUI sits in between and forms an abstraction that allows you do something else for each platform.
If you run my code on Windows with the handler, you get the rating control. If you run it on Android, you get a blank view as the Android handler is not yet created. You can then decide how you want to make this handler for Android or iOS and hook up events and properties accordingly.

Getting Error HTTP Error 500.34 - ANCM Mixed Hosting Models Not Supported after HTTP Error 500.35 - ANCM Multiple Hosting models not supported

I am getting error "Error HTTP Error 500.34 - ANCM Mixed Hosting Models Not Supported" after adding
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
</PropertyGroup>
to my application.config.host, I was trying to resolve HTTP Error 500.35 - ANCM Multiple Hosting models not supported by adding above code snippet to application.config.host. Any help would be appreciated. Thanks
This issu occured because you may have different hosting model on you web apps under the same server where you have hosted your all web apps ,so you need to change hosting model for all ur web apps to be outofprocess by adding below line
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
I got the same error when I changed target SDK to .Net Core 3.1.
My solution was remove hostingModel="inprocess" from aspNetCore tag in file web.config.
Sure it can be made cleaner, but at least the app works.
Hope it may help someone.
<aspNetCore processPath="dotnet" arguments=".\XXXXXXX.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess"/>
I got it resolved.
I was loking for my applicationhost.config file in the .vs folder, to start i was unble to find .vs folder in my project folder. I manually typed C:\Users\v-wauddi\Desktop\Dutch Treat\DutchTreat.vs\DutchTreat\config\applicationhost.config and i was able to get applicationhost.config, I saw an unusual entry, I fixed it by commenting that unsual entry which can be seen in the below code.
<site name="DutchTreat" id="2">
<application path="/" applicationPool="DutchTreat AppPool">
<virtualDirectory path="/" physicalPath="C:\Users\v-
wauddi\Desktop\Dutch Treat\DutchTreat\DutchTreat" />
</application>
//commented out section
<!--<application path="/App" applicationPool="App AppPool">
<virtualDirectory path="/" physicalPath="C:\Users\v-
wauddi\Desktop\Dutch Treat\DutchTreat\DutchTreat" />
</application>-->
<bindings>
<binding protocol="http" bindingInformation="*:8888:localhost" />
</bindings>
</site>
I was going mad due to this issue from last 30-40 minutes. At last I deleted the .vs folder and reopened the project.
It works like charm.
Steps:
Open your solution folder.
exit project and close visual studio.
delete the vs folder, it might be hidden, so you need to enable
hidden items as shown below :
At last reopen project, it will take some extra seconds to reconstruct the files in .vs folder.

The V2 feed at ‘…’ returned an unexpected status code '503 Service Unavailable'

I know there are similar questions, but none with this exact error, so I'm hoping there is a different answer.
I'm getting the error:
[feedname] The V2 feed at 'http://domain.tld/NuGetServer/nuget/Search()?$filter=IsLatestVersion&searchTerm=''&targetFramework='net46'&includePrerelease=false&$skip=0&$top=26&semVerLevel=2.0.0' returned an unexpected status code '503 Service Unavailable'.
I recieve this failure in the Package Manager UI in Visual Studio (2017 Professional), as well as the Console in VS. I have tried clearing the NuGet caches, TFS caches, checking (and modifying, as appropriate) proxy settings for NuGet (AppData\Local), proxy settings for TFS, Internet Options proxy settings, with apparently no change in results. I also tried accessing the feed in VS 2010, and it doesn't work there as well.
Why could this be happening? It seems like a proxy-related issue, but I've tried everything that other questions mention, and to no avail.
One clue might be the following: When I access the feed URL via a browser, I get the following back:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed xml:base="http://domain.tld/NuGetServer/nuget/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
<title type="text">Search</title>
<id>http://domain.tld/NuGetServer/nuget/Search</id>
<updated>2018-06-25T21:31:57Z</updated>
<author>
<name />
</author>
<link rel="self" title="Search" href="Search" />
</feed>
This is what I get when excluding the Search parameters:
<service xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns="http://www.w3.org/2007/app" xml:base="http://domain.tld/NuGetServer/nuget/">
<workspace>
<atom:title>Default</atom:title>
<collection href="Packages">
<atom:title>Packages</atom:title>
</collection>
</workspace>
</service>
The NuGet server was configured incorrectly. I'm not exactly sure what the issue was, but once the server was re-configured to be have the default settings, and the URL in Visual Studio matched the server-configured URL, the issue was resolved.

IBM Notes: Eclipse Plugin deployment to framework directory

I am not totally sure, if this question is in the right forum here, but as it is about a development environment and deploying developments I think it is save to ask.
I have a plugin for the IBM Notes client that I need to install silently in the background.
I used "CustomizeAddon.exe" to create a package and created an install.addon.xml with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<ibm-portal-composite>
<domain-object name="com.ibm.rcp.installmanifest">
<object-data>
<install>
<installfeature id="Jabber4Notes" required="true">
<requirements>
<feature id="com.endava.jabber4notes.feature"
version="2.11.8.298" match="compatible"
shared="true" mergeaction="add"
url="jar:${installer.root}/updateSite.zip!/" />
<feature id="com.endava.jabber4notes.IMPFragmentFeature"
version="2.11.8.298" match="compatible"
shared="true" mergeaction="add"
url="jar:${installer.root}/updateSite.zip!/" />
</requirements>
</installfeature>
</install>
</object-data>
</domain-object>
</ibm-portal-composite>
But although I use the parameter shared="true" the plugin always installs to the workspace directory instead of the feature- directory.
How can I change this behaviour?
Make sure to have write permissions on the shared site.
If that's not the problem try to use colocation affinity to specify that the deployment site should be the same of another plugin; com.ibm.rcp.site.anchor.shared.feature is always installed on the shared site so you could add this:
colocation-affinity="com.ibm.rcp.site.anchor.shared.feature"
Here you can find more information regarding this topic: LINK

First Program - No Launcher activity found

I am struggling to get my first Android application to run. I create a new Android Application Project and ask for a "Blank Activity" on the Create Activity dialog box.
When I run the Dave application as an Android project, I get the following console messages in red:
[2014-07-04 22:14:40 - MyFirstProject] No Launcher activity found!
[2014-07-04 22:14:40 - MyFirstProject] The launch will only sync the application package on the device!
The Virtual Device shows up, and when I unlock it there is no Dave application.
Where am I going wrong?
you need to declare in your manifest the activity .. and add a category also ..declaring it as a launcher.
like here.. it would have been nice if you could just google a little more :)
code snippet:
<activity
android:name=".YourActivityName"
android:clearTaskOnLaunch="true"
android:label="#string/activity_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Turns out the problem with the missing activity and launcher are caused by Eclipse. I found a post click here where someone else had this kind of problem and fixed it by NOT installing the SDK and Eclipse bundle, but rather installing components separately. Now the new application gets generated properly.