Using maps in a native App - mapkit

Building an ios app using apache cordova 2.1. Building and styling is going fine but maps are not.
I found a plugin for the maps but simply cannot get it to work:
https://github.com/phonegap/phonegap-plugins/tree/master/iOS/MapKit
I also found an example html file but could :
https://github.com/phonegap/phonegap-plugins/tree/master/iPhone/MapKitPlug/example
1/
So i added the MapKit framework into xcode which was pretty straight forward:
http://blog.thinketg.com/blog/david-brainer-banker/xcode-4-tips-adding-frameworks-to-your-project
2/
Added the .m and .h files
3/
Added and linked the .js file to my index.html
4/
copied the example html above.
5/
Added the Mapkit to the .plist file as per the instructions
When I try to run the map I get the following errors:
2012-11-05 14:21:29.505 sawdaysApp[25398:c07] Multi-tasking -> Device: YES, App: YES
2012-11-05 14:21:30.895 sawdaysApp[25398:c07] CDVPlugin class MapKitView (pluginName: MapKitView) does not exist.
2012-11-05 14:21:30.895 sawdaysApp[25398:c07] ERROR: Plugin 'MapKitView' not found, or is not a CDVPlugin. Check your plugin mapping in Cordova.plist.
2012-11-05 14:21:30.896 sawdaysApp[25398:c07] FAILED pluginJSON = [null,"MapKitView","showMap",[]]
2012-11-05 14:21:30.896 sawdaysApp[25398:c07] CDVPlugin class MapKitView (pluginName: MapKitView) does not exist.
2012-11-05 14:21:30.896 sawdaysApp[25398:c07] ERROR: Plugin 'MapKitView' not found, or is not a CDVPlugin. Check your plugin mapping in Cordova.plist.
2012-11-05 14:21:30.897 sawdaysApp[25398:c07] FAILED pluginJSON = [null,"MapKitView","setMapData",[{"diameter":1000,"offsetTop":25,"lon":-123.104446,"buttonCallback":"cbMapCallback","lat":49.281467999999997,"height":360,"atBottom":true}]]
I assuming that the error is with the MapKitView in the CDVPluggin, but really not sure.
Has anyone had any experience with this and succeeded?

THIS WORKS. AT LAST :)
1 - Follow this guide to start the app http://docs.phonegap.com/en/2.1.0/guide_getting-started_ios_index.md.html
2 - Download and add mapkit plugin native files (all of them) in the plugins folder and the .js file in the www folder. https://github.com/phonegap/phonegap-plugins/tree/master/iOS/MapKit.
Make sure you drage the pluggins folder to the pluggins folder in xcode otherwise the app will not link the files properly.
3 - Whitelist * to whitelist all the domains and Add the plugin reference on Cordova.plist MapKitView as value and key
4 - Donwloaded and included into the sawdaysTestApp/pluggins folder JSONKit.h and JSONKit.m https://github.com/johnezang/JSONKit
5 - Change mapkit.h and .m
#ifdef CORDOVA_FRAMEWORK
#import <Cordova/CDVPlugin.h>
#else
#import "CDVPlugin.h"
#endif
to
#import <Cordova/CDVPlugin.h>
and
change mapkit.m
from
#ifdef CORDOVA_FRAMEWORK
// PhoneGap >= 1.2.0
#import <Cordova/JSONKit.h>
#else
// https://github.com/johnezang/JSONKit
#import "JSONKit.h"
#endif
to
#import "JSONKit.h"
Get the example from https://github.com/phonegap/phonegap-plugins/blob/master/iPhone/MapKitPlug/example/index.html. Copy and paste entire example into index.html.
7 - Change the index.html
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8" src="MapKitPlug.js"></script>
to//
<script type="text/javascript" src="cordova-2.1.0.js"></script>
<script type="text/javascript" charset="utf-8" src="MapKit.js"></script>
8 - Run the simulator. click the show map button.

I'd just like to add two things:
1, That as of Cordova 2.3.0 the filename
Cordova.plist
Is now
yourProject-Info.plist
yourProject being what ever your project name is.
2, I found that you still need to 'Link Binary With Libraries' by doing the following:
Click on your project
Select Build Phases
Click the arrow on Link Binary With Libraries
Click Add
Search for MapKit.framework and click Add

Related

How to whitelist a vendor-specific API in AOSP for Android 10

I'm trying to add a vendor-specific API to my AOSP code base. I was able to get this working on Android 5 through 9, but cannot figure this out on Android 10.
I read the documentation on the AOSP docs for Implementing Java SDK Library
I have the following blueprint file:
java_sdk_library {
name: "com.mycompany.sdk.myclass",
srcs: ["java/**/*.java"],
api_packages: ["com.mycompany.sdk.myclass"],
}
I generated the api subdirectory using:
build/soong/scripts/gen-java-current-api-files.sh "vendor/mycompany/sdk/myclass" && m update-api
This put all my public method signatures into the current.txt file.
I added this as a boot jar to my top level board.mk file with:
PRODUCT_BOOT_JARS += com.mycompany.sdk.myclass
Building this creates the corresponding com.mycompany.sdk.myclass.xml permissions file:
<?xml version="1.0" encoding="utf-8"?>
<permissions>
<library name="com.mycompany.sdk.myclass"
file="/system/framework/com.mycompany.sdk.myclass.jar"/>
</permissions>
Everything builds and installs fine. I verified the permissions file is in /system/etc/permissions/ and points to the correct jar filename. But I get "Accessing hidden method (blacklist, linking, denied)" exceptions when I run a test app built against my private SDK:
W/test_app: Accessing hidden method Lcom/mycompany/sdk/myclass;->myMethod(Landroid/content/Context;Z)V (blacklist, linking, denied)
I can eliminate this blacklist error by issuing the command:
adb shell settings put global hidden_api_policy 1
So I know my jar is being built and installed correctly. But is just blacklisted for 3rd parties.
I eventually added my package name to frameworks/base/config/hiddenapi-greylist-packages.txt, and suddenly my test app runs, and properly finds the private API. Unfortunately, the blacklist errors are replaced by greylist warnings on every method call. I don't want the log cluttered with these warnings, so it must be whitelisted, not greylisted.
I tried adding it to /build/make/core/tasks/check_boot_jars/package_whitelist.txt, but this made no difference.
How do I whitelist my private API instead of greylist?
There is no white list.
The white list (allow list) is the methods listed in Android SDK.
Private API are not in Android SDK.

Use leveldb-library.framework from firebase for iOS with Xcode9

I would like to be able to use the leveldb-library.framework that google is shipping with their firebase iOS SDK. I don't seem to be able to import the framework.
What I did:
1: copy leveldb-library.framework to project dir
2: in Xcode > Target > Linked Frameworks and Libraries [+] add the framework
3: make sure the header search path it set correctly
4: add a Objective-C++ wrapper class and import the leveldb headers
Getting a linker error:
/Users/ronny/projects/clients/internal/TestCD/TestCD/LevelDB.mm:11:9: fatal error: 'leveldb/db.h' file not found
#import "leveldb/db.h"
^~~~~~~~~~~~~~
1 error generated.
The Headers directory in the framework provides all the headers: db.h, options.h but without the "leveldb" parent directory.
Changing the imports to the following throws the same error:
#import <leveldb/db.h>
#import <leveldb/options.h>
Once I change the imports to this:
#import <leveldb-library/db.h>
#import <leveldb-library/options.h>
the linker is able to find the includes but throws another error:
In file included from /Users/ronny/projects/clients/internal/TestCD/TestCD/LevelDB.mm:11:
/Users/ronny/projects/clients/internal/TestCD/leveldb-library.framework/Headers/db.h:10:10: fatal error: 'leveldb/iterator.h' file not found
#include "leveldb/iterator.h"
^~~~~~~~~~~~~~~~~~~~
1 error generated.
At this point I am no longer sure what can be done in order to resolve this. Adding the import path doesn't help either. Xcode completes the import as such:
Any pointers towards solving this would be greatly appreciated. The project can be found here: https://github.com/ronnyf/TestCD
The framework expects to be called leveldb, but your example calls it leveldb-library.
mv leveldb-library.framework leveldb.framework
mv leveldb.framework/leveldb-library leveldb.framework/leveldb
Update the Xcode project with the renamed framework and it successfully builds.

UI Testing xCode 7.3 - Cannot print variables (i.e 'po app') in the console: (could not build Objective-C module 'Bolts')

I have UI testing project set up and was working perfectly in xCode 7.2. Since I upgraded to xCode 7.3 I cannot print any variables in the console. I set breakpoints in both Application (main project) and UI Test, 'po' command works in the main project but as soon as it reaches UI testing the 'po' command stop working. I have tried almost all the solutions I could find on the internet but still no luck. It complains about the Objective-C module 'Bolts' that I am not using at all in UI testing. Below is how the error message looks like:
(lldb) po app
error: Error in auto-import:
failed to get module 'MyUITestProject' from AST context:
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/Bolts-umbrella.h"
^
/Users/../Pods/Target Support Files/Bolts/Bolts-umbrella.h:7:9: note: in file included from /Users/../Pods/Target Support Files/Bolts/Bolts- umbrella.h:7:
#import "BFAppLinkReturnToRefererController.h"
^
/Users/../Pods/Bolts/Bolts/iOS/BFAppLinkReturnToRefererController.h:14:9: error: include of non-modular header inside framework module 'Bolts.BFAppLinkReturnToRefererController'
#import <Bolts/BFAppLinkReturnToRefererView.h>
...
...
Is there anyone run into the same issue? Does anyone knows what cause this failure and any advice?
Delete:
/Users/{User}/Library/Developer/Xcode/DerivedData
and then restart your Xcode.

Showing Sass::SyntaxError when using bootstrap 3.3.0 in rails

I am using bootstrap 3.3.0 in my rails app but is showing below error
Error compiling asset application.css: Sass::SyntaxError: Undefined mixin 'hide-text'.
(in ../app/assets/stylesheets/application.css.scss)
Served asset /application.css - 500 Internal Server Error
Here is my application.css.scss
#import "bootstrap";
#import "bootstrap-timepicker";
#import "bootstrap-datepicker";
#import "globals/functions";
#import "globals/mixins";
#import "globals/variables";
/*#import "base";
#import "layout";*/
#import "style";
#import "vistyle";
#import "framework_and_overrides";
#import "modules/events";
#import "modules/gallery";
#import "modules/forms";
Sass::SyntaxError: Undefined mixin 'hide-text'.
hide-text is written in modules/events.css.scss file.
Its working fine with bootstrap '2.3.1.0' but not for bootstrap '3.3.0' .
It may have something to do with the version of Rails you are using. You have not specified it, but I'll assume it is Rails 3.2 (as I've had the same issue with it.) I also assume that you have the gem in the 'assets' group. If that's the case your app looks very similar to the one I've had the same issue with.
Basically this is because by default in Rails 3.2, assets group gems are not required in production.
For details, see the updated docs in the bootstrap-sass README:
https://github.com/twbs/bootstrap-sass/commit/1a4ff080af2be55f1c17b5d2c99eb5f31aaf2e97

Sencha Command - #import 'sencha-touch/default/all' not found

When I run the sencha command like so:
sencha app build production
I get an error which points to the following line in app.scss:
#import 'sencha-touch/default/all';
In my app I have the following folder:
\App\touch\resources\themes\stylesheets\sencha-touch\default
But there is no 'all' folder. Is my application structure broken or is there something else I am missing?
The error might be generated because there's no _all.scss inside
touch\resources\themes\stylesheets\sencha-touch\default
Contents of _all.scss are
#import 'core';
#import 'widgets';
Check application structure again or just create _all.scss manually and see if it solves problem.