BlackBerry Cascades 10 Maps example keeps showing black screen - blackberry-10

I am trying to run the maps example Qml however my MapView keeps loading as a just black. I checked the console output and spotted this.
slogger2 buffer handle not initialized. ../../lgmon_api.c, logEvent(), around line 578!
cpp:: Created document
cpp:: properties set
MapViewPrivate::removeRenderEngine
using the following render engine: bb::cascades::maps::BlankRenderEngine
MapViewPrivate::removeRenderEngine
removing the old render engine: bb::cascades::maps::BlankRenderEngine
RenderEngineManager::RenderEngineManager
RenderEngineManager::scanForPlugins()
render engine search: searching QDir( "/apps/com.example.GConnectBB.testDev__GConnectBB7836cab4/native/mapview-renderengine" , nameFilters = { * }, QDir::SortFlags( Name | IgnoreCase ) , QDir::Filters( Dirs|Files|Drives|AllEntries ) )
render engine search: searching QDir( "/base/usr/lib/qt4/plugins/mapview-renderengine" , nameFilters = { * }, QDir::SortFlags( Name | IgnoreCase ) , QDir::Filters( Dirs|Files|Drives|AllEntries ) )
render engine search: attempting to load "/base/usr/lib/qt4/plugins/mapview-renderengine/libRenderEngine3d.so"
unknown symbol: _ZTIN2bb8platform3geo11GeoLocationE
unknown symbol: _ZTIN2bb8platform3geo11GeoLocationE
unknown symbol: _ZNK2bb8platform3geo11GeoLocation10metaObjectEv
unknown symbol: _ZN2bb8platform3geo11GeoLocation11qt_metacastEPKc
unknown symbol: _ZN2bb8platform3geo11GeoLocation11qt_metacallEN11QMetaObject4CallEiPPv
unknown symbol: _ZNK2bb8platform3geo11GeoLocation11boundingBoxEv
unknown symbol: _ZTIN2bb8cascades4maps17BlankRenderEngineE
unknown symbol: _ZN2bb8cascades4maps17BlankRenderEngine16staticMetaObjectE
unknown symbol: _ZTIN2bb8platform3geo10GeographicE
RenderEngineManager::engine( <ViewProperties altitude=0, heading=0, lat=43.4682, lon=-80.5196, tilt=0, window=QSize(0, 0) > )
using the following render engine: bb::cascades::maps::BlankRenderEngine
So it looks like it is not loading a proper render engine for my map. I tried updating my SDK and updated the OS on the phone using the blackberry OS update to no avail.
Here is the full Qml for my map:
import bb.cascades 1.0
import bb.cascades.maps 1.0
Page {
Container {
layout: StackLayout {
}
MapView {
id: mapview
latitude: 43.468245
longitude: -80.519603
altitude: 10000
}
}
}
More details:
OS Version: 10.9.10.35
Native SDK: 10.0.9.1673
Momentics Version: 10.0.9
I tried another SDK version too, 10.0.10.xxx and it didn't work either.

As #Hithredin mentioned above in a comment, in order to have maps functionality you need to make sure that you specified all the libraries to link for linker in your .pro file:
LIBS += -lbbplatform -lbbcascadesmaps -lGLESv1_CM
and also if you're using geolocation (which happens pretty often when you use maps) you need to have the following set of permissions in your bar-descriptor.xml file:
<permission>read_geolocation</permission>
<permission>access_location_services</permission>
More about maps and location on Blackberry dev site:
Location documentation
Maps documentation

make sure to include
#include <bb/cascades/maps/MapView>
in your ApplicationUI.hpp or ApplicationUI.cpp.

Related

Flutter : How to convert to longitude and latitude to plus code (open location code) and vice versa

I have just developed an app using dart and flutter which I can obtain latitude and longitude of the location. My app can handle this. But I want to convert this longitude and latitude to open location codes(plus code) and show corresponding plus code in my app view
Also if I enter plus code also for the second stage it will convert to longitude and latitude.
I am stuck with this conversion.
If anyone here help me I will really be appreciated.
I didn't find the package on pub.dev, so you have to use the library I mentioned above, directly from GitHub. It is provided by Google, so it should be pretty safe and well maintained.
To do that you add it in pubspec.yaml like this:
dependencies:
flutter:
sdk: flutter
open_location_code:
git:
url: git://github.com/google/open-location-code.git
path: dart
Then, in your code you import the library with:
import 'package:open_location_code/open_location_code.dart' as olc;
To convert the lat&lon to plus code you do this (creating a CodeArea object):
// Googleplex
// 1600 Amphitheatre Pkwy
// Mountain View, CA 94043
// The coordinates of Google's Global HQ
var codeFromLatLon = olc.encode(37.425562, -122.081812, codeLength: 1000000);
print(codeFromLatLon.toString());
// The above will print '849VCWG9+67GCC32'
To decode the plus code to lat lon you do this:
var codeFromPlusCode = olc.decode('849VCWG9+67GCC32');
print(codeFromPlusCode.toString());
// The above will print:
// CodeArea(south:37.425562, west:-122.08181201171875, north:37.42556204, east:-122.08181188964843, codelen: 15)
In order to access the lat&lon you'll have to do the following:
print('Lat: ${codeFromPlusCode.center.latitude}, Lon: ${codeFromPlusCode.center.longitude}');
Note that you can limit the length to 10 when you encode the lat&lon pair in your plus code. This will give you a shorter code, but a less accurate positioning:
var codeFromLatLonShorter = olc.encode(37.425562, -122.081812, codeLength: 10);
print(codeFromLatLonShorter.toString());
// The above will print '849VCWG9+67'
Hope the above will help. Here is a detailed explanation.

Why does this Facebook page can't be displayed within a StageWebView?

By trying to open the website https://www.facebook.com/nike within a StageWebView, I received the following error:
ReferenceError: Can't find variable: console at
https://fbstatic-a.akamaihd.net/rsrc.php/v2/y2/r/KK4271o6DmT.js : 95
TypeError: Result of expression 'bigPipe' [undefined] is not an
object.
The website stopped loading and couldn't be displayed completly.
This is the Air/AS3 code I'm using:
var webView:StageWebView = new StageWebView();
webView.stage = this.stage;
webView.viewPort = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight);
webView.loadURL("https://www.facebook.com/nike")
How to get to load the website within StageWebView completely?
(Is there a way to ignore the errors?)
I'm using Flash CS6 and Adobe Air 3.9
I think this is a Embedded WebKit issue, you can Switch your webkit engine from Embedded to System browser engine. I tested using system browser its working fine, because it take our systems browser, you can switch your webkit engine by StageWebView( true ).
private var webView : StageWebView;
webView = new StageWebView( true );
webView.stage = this.stage;
webView.viewPort = new Rectangle( 0, 0, 1024, 768 );

Samsung Smart TV Closed Caption Support VOD JavaScript App

I've been trying to get closed captions working with the SEF player, but haven't had any luck. My app uses playready streams and I've tried side loading the SAMI files, but I get errors. I would prefer to do side loading, but if I can get embedded closed captions to work that would be a first step. There seems to be limited and conflicting documentation and posts on the Samsung developer's forum so I'm hoping to find someone who has gotten this to work on 2012/2013 devices.
Here's what I have tried:
var SefPlugin = document.getElementById('pluginDL');
alert(" " + SefPlugin.Open("Download", "1.000", ""));
alert(SefPlugin.Execute('GetPluginInfo'));
var ret = SefPlugin.Execute('StartDownFile', 'http://testurl.com/test.smi', '$TEMP/subtitle.smi', 10, 10);
alert("SUBTITLE DOWNLOAD RETURNED: " + ret);
The output is:
JS ALERT: 1
JS ALERT: 1
JS ALERT: SUBTITLE DOWNLOAD RETURNED: 1
Then in the OnStreamInfoReady method I attempt to do this:
alert(" START SUBTITLE: " +Player.plugin.Execute("StartSubtitle", '$TEMP/subtitle.smi'));
alert("SET STREAM ID: " +Player.plugin.Execute("SetStreamID", 5, 0));
The output is:
JS ALERT: START SUBTITLE: -1
JS ALERT: SET STREAM ID: 1
The StartSubtitle returning -1 is an error and I'm not sure what the problem is with this scenario.
I also tried the AVPlay plugin by downloading the subtitle file the same way as above. Then, I tried to initiate a play action by calling:
var subtitleDataCallback = (function(syncTime, data) {
alert(syncTime + " : " + data);
})();
Main.AVPlayerObj.open('http://testurl.com/test.mp4',
{
subtitle: {
path: "subtitle.smi",
streamID : 0,
sync : 1000,
subtitleDataCallback: subtitleDataCallback
}
});
It plays the content if I leave out the subtitle object, but when I have the subtitle object there it gives me the following error:
JS ALERT: ======================================= ERROR2: TYPE_MISMATCH_ERR
I tried $TEMP/subtitle.smi for the path as well, but I receive the same mismatch error. Any guidance would be greatly appreciated.
I never actually got subtitle files to work with the player. I found a subtitle parser and ripped it out from (http://mediaelementjs.com/). It gives you each subtitle entry in an array that has the time when the subtitle should start showing and when it should stop showing.

how to retrieve an image from path in iOS ( for iPhone) with Flex

How can I retrieve the path of an image stored in my album in an iPhone using Flex mobile? same with an image being taken with the camera on the iPhone.
for Android I use this function and it works, but for the iPhone, it doesn't any ideas?
protected function onMediaSelect(event:MediaEvent):void
{
var mp:MediaPromise = event.data;
image.source = mp.file.url;
}
and this I use for when I'm taking th picture ont he spot
protected function onComplete(evt:MediaEvent):void
{
img.source = evt.data.file.url;
}
if you can show me in the right direction I greatly appreciate it. thanks!
~Myy
image.source = File.desktopDirectory.resolvePath(file_name).url;
this one it will work only under windows...
image.source = File.desktopDirectory.resolvePath(file_name).nativePath;
the source property of Image passing a filename that start with / (/ is root for unix based OS, android, linux, ios, etc), will take is as a relative path instead of complete path...
I ad to use the cameraroll class
//if we get the image
trace( "Asynchronous media promise." );
var eventSource:IEventDispatcher = dataSource as IEventDispatcher;
eventSource.addEventListener( Event.COMPLETE, onMediaLoaded );

MKMapKit on iOS 6 and Google Maps on older devices

I'd like to show maps on iOS 6 by using MKMapItem but I'd also like to use Google Maps for older iOS versions.
When I test my solution on iOS 5.1 I have this error
dyld: Symbol not found: _MKLaunchOptionsDirectionsModeDriving
This is my code :
if Utils.older_than_ios6?
url = "http://maps.google.com/maps?saddr=#{#party.place.location[1]},#{#party.place.location[0]}&daddr=#{#party.place.location[1]},#{#party.place.location[0]}"
App::open_url(url)
else
address_dictionnary = ({kABPersonAddressStreetKey: #party.place.street, kABPersonAddressCityKey: #party.place.city,kABPersonAddressZIPKey: #party.place.postal_code})
place = MKPlacemark.alloc.initWithCoordinate(#coords, addressDictionary: address_dictionnary)
mapItem = MKMapItem.alloc.initWithPlacemark(place)
mapItem.name = "#{#party.name}"
options = ({
MKLaunchOptionsDirectionsModeKey: MKLaunchOptionsDirectionsModeDriving
})
mapItem.openInMapsWithLaunchOptions(options)
end
This link shows that MKLaunchOptionsDirectionsModeDriving is available only on iOS6+.
And just to be sure, did you add MapKit to the list of frameworks in your Rakefile ?