I have used the c++ google protobuf classes in iOS using the native app approach, i.e. using Xcode, objective c, cocoa etc.
Now, I want to migrate to hybrid apps and I have explored the options on web, and according to my requirements i'm down to PhoneGap and Titanium. That will require me to use JavaScirpt, HTML5 (JavaScript only in Titanium as per my understanding) jQuery etc.
My question is, HOW am i supposed to access the my c++ protobuf classes from javascript. (i have no expertise in JavaScript).
I am also open to opinions on which hybrid-app framework to use.
Lords of web-dev....guide me.
With PhoneGap, if there is a phone feature that the PhoneGap APIs do not currently expose, or if you have some specialised native algorithm / function that you wish to access, then you need to write a plugin.
PhoneGap plugins provide a standardised mechanism for packing native code and accessing its functionality via JavaScript. See the PhoneGap Plugin Development Guide.
Personally I think PhoneGap is the best hybrid framework, it had been around for a while, is well documented, and has a healthy community.
This is an old question, but you can always use the 100% JavaScript implementation of ProtoBuf in your JavaScript code. It works well, and you can even precompile the .proto file if you want.
In Cordova it would be better to create a plug-in, but if you don't have time or skill to do that, the linked code works well.
Related
I really want to make use of the pencil kit in my react-native application. I just want to know whether I can do it. If yes, then how?
TLDR: Doesn't exist as of 2/6/2021 and you will need to write bridge code between react native (js) and native (swift/ObjC). There are big performance limitations with this approach. I recommend you create a native Swift based app for your project.
I was also curious if this is available.
For those willing to use Swift, here's the sample shown during the demo.
For those that want to use PencilKit / CoreML native libraries from React native you need need to write bridge code between Javascript (please use typescript) and the native code.
Here's more information on bridging and a guide.
For me, I will be building a note taking app and it needs to be performant. Despite being a react / react native developer I will be choosing Swift to build this project due to performance concerns.
Last point to make is that you can use react native and native together. But this is more of a headache than an enabler. AirBnB used this for some time but moved away from this approach.
For anyone new to React Native, it's a great platform. I personally like to use it for simple applications (not graphically intensive). You can also use it with the Expo tooling which speeds up prototyping but be warned some functionalities are not available bluetooth is one example.
Yes I Did it.
I created a native view for iOS Pencil Kit in React Native with Swift.
You can check basic examples for native module in my Repo
I need to create a multi-platform app for web, ios, android and partially desktop.
I wish to use .NET/F#, but the UI is a complication. I have tried Xamarin.Forms and it is too limited to me. I could live to use React Native but I don't wanna to code the full app in javascript, instead, I wish to use F# for all the logic and web backend, and use react only for the UI in mobile.
But I wonder how?
How feed data to the UI and react to events there?
P.D: If nativescript make this possible I'm all ears. I'm still not rule out xamarin for it, but forms is too limited and the nature of the apps and so far think react native is the closer to my needs.
There's already a sample of this, because the entry file of the Fable React Native demo is a pure JS file that calls the JS generated by Fable. You just need to extend this pure JS layer and import the code generated by Fable when needed.
Subject line pretty much describes it. I'm looking for a toolchain to build a cross-platform business logic library that would be consumed by (among others) an otherwise native iOS application.
I'm thinking about using F# for this library, as I like its functional approach and what I've read about performance seems at least reasonable.
I'm wondering how feasible it is to write this library in F# and then invoke/consume it from an otherwise native (probably Swift) application on iOS.
You can use Fable to compile your library and then write your app in React Native to consume it as a native app in iOS. Here are some interesting things you can do with Fable. http://www.navision-blog.de/blog/2016/08/14/fable-sudoku-creating-a-sudoku-solver-app-with-f/
If you don't want React Native, then your other option is to call the generated JS code directly from your native code, but that's a bunch of boilerplate and casting for each function call. How to call JavaScript Function in objective C
The solution I think you're hoping for is to be able to compile to Xamarin and use the library from an iOS app like a native library, however that's not possible.
I'm a beginner in developing iOS apps with Xamarin and MVVMCross. MVVMCross fits perfectly on top of the Xamarin developing platform and its features are outstanding! I've watched several of the MVVMCross N=x tutorial videos on youtube, what helps me a lot to understand how to use the framework.
The iOS app i'm currently working on should use a database encryption, to secure the data. Therefore i wanted to use the Xamarin SQLCipher component. And here come my problems into play:
As far as i know it is a platform specific library, but i wanted to write a MVVMCross-SQLCipher-plugin, like the SQLite Community Plugin, which is separated in a PCL core and a platform specific library. Any suggestions how i can do this or is it impossible because of the SQLCipher-architecture?
We used the standard SQLite implementation included in MvvmCross and just swapped the binaries for SQLite to SQLCipher out and it works fine.
I believe all the calls are the in both binaries so there should be little else requried just make sure you set a password on the database when you do:
new SQLiteConnection(databasePath, password)
I want to build an iPhone app, but I only know PHP, JavaScript, CSS and HTML. I heard that I can use Phonegap to build the app in javascript and it converts the JavaScript to Objective-C. Is that true? The phone gap documentation was hard to understand. What other solutions do I have?
Yes and no.
Phonegap (nowadays known as Apache Cordova) enables you to bundle web pages/applications as native phone apps. It also provides you with some JavaScript bindings to native phone APIs that you otherwise wouldn't be able to access (=with a plain webpage). These bindings include (just to name a few) Accelerometer, Camera and Compass. That's pretty much all it does - you still have to figure out how to write your application with JavaScript, HTML and CSS.
Try out how it works by checking out "Getting Started with iOS".
If you know all these languages you mentioned that is well enough for developing an iOS App(as well as you can develop the same apps in Android).
I would suggest you to go for PhoneGap(Cordova) framework to develop these apps. Using this framework you'll have to use HTML/HTML5, JavaScript, CSS, PHP and get the iOS App running on your device. Here to StartWith and then check out APIDocs. You will always get a lot of tutorials on google itself.
You can also refer This Question for gathering some knowledge about other frameworks available in market.
Hope it helps.
I would suggest Phonegap, but you can't use PHP with Phonegap apps directly... There are a few hacks around this though.
Although Phonegap is supposed to be "one codebase, distribute everywhere", if you want a really great looking app you'll have to spend a liitle time adjusting the UX for every platform or device. The thing I really like about Phonegap is that you can open up a HTML page locally on your browser and move thing around in firebug, making the process faster.