How to use module in kotlin Mutliplatform moblie - android

Hey I am learning Kotlin Multiplatform mobile. I starting learning from the doc. I successfully run the module in android and ios platform, without any problem. Now I want to implement this in real project. I successfully created the module inside my pre-existing android directory. According to this Make your cross-platform application work on iOS we can only use module inside the android directory. I work as android developer and my other team have ios developer. So the problem is we have different system for android and ios. So how can I share this module to the Ios team. Please guide me how to achieve this. I read somewhere ios need XCFramework. But I am not sure, how can I achieved this. Can someone guide me step wise? Thanks

In general, Kotlin Multiplatform Mobile provides you with an ability to build frameworks for iOS. It can be delivered in several ways:
Simple ModuleName.framework file ready to be imported into your teammate's app,
CocoaPods integration, providing your teammate with the ability to rebuild this framework from sources and to use third-party libraries from Kotlin code,
Universal (fat) framework and XCFramework. These two are designed to provide the framework user with the ability to build the result app for different CPU architectures. This would be helpful when publishing the app.
If your aim is to just show the iOS team an example of Kotlin Multiplatform Mobile power, I think it would be enough to declare the framework, build it by executing the appropriate gradle task and share the result file.
If they would also like to put some code into the iOS-specific part of your module, adding the CocoaPods integration will be a good idea.

Related

How to build my react native app with TeamCity?

I start using Team City and my app builds with react native version 0.60.5...
I was wondering what will be the best and the easier way to build my app for iOS and android.
For iOS I was thinking using the Xcode plug.
For android I'm thinking to use Docker but its complicated and taking time to develop..
Does someone has any recommendation what to use for building my android app or Docker is a good solution?
And about the iOS, are you recommend use the Xcode plug or any other idea?
Thank you for the help
You can easily use TeamCity to automatize your build for Android, check the official documentation for more information:
You just need to be careful specifying the requirements for build your project for React Native, like:
version of react native, version of expo-cli, version of node that you are using in your project and etc...
For IOS, i recommend using fastlane, check this official tutorial from Apple.
Don't forget that you need to have an developer account for build to ios in React-Native.

Cross platform native games with Visual Studio

Please note that I looked through all of the Visual Studio documentation for an optimum solution but I couldn't find any info :-)
I am going to develop my new game and this time I want to use C++ and Visual Studio. The game will run on iOS and Android and desktop. I work on a Mac Book Pro and run Windows and OS X on my computer simultaneously (with the help of VMWare Workstation).
The game will run on OpenGL ES with the help of some other frameworks (SFML). I'm trying to gather information on how to setup my solution and how should I use platforms specific APIs.
I assume I have to use OpenGL ES Application (Android, iOS) for the game itself and Shared Library (Android, iOS) for the game engine code.
Now comes the question, where should I put platform specific implementations including but not limited to:
In-App Billing for Android
In-App Purchases for iOS
Chartboost/AdColony SDK for Android and iOS
Some iOS-Only features implemented in Obj-C code
Basically I need to find a way to setup my projects in Visual Studio. I think I need to set up like this:
Game Engine Project (Shared Library): This will hold the game engine code that'll be shared on all platforms (let's assume only iOS and Android for the sake of simplicity).
Shared Interfaces Project (Shared Library): This will hold the shared interfaces for the platform specific API calls, like in-app purchases, etc. This project will only include the interfaces, not the actual implementations.
Android Project (OpenGLES Application): An Android native project to run the game on Android devices. This project will hold the Android implementations for the interfaces defined in the shared project.
iOS Project (OpenGLES Application): Similar to the previous one, only for iOS.
I don't know if the solution architecture is correct. If it is, how should I implement the iOS specific features. I know I need to use XCode for this. Do I have to create an XCode project on Mac and develop the iOS feature there using the Shared Library projects?
I'm really confused :-)

Can I build Android apps with react native?

The recently launched react native features just iOS app example and docs.
Yes.
React Native for Android was released September 14th, 2015.
Docs: http://facebook.github.io/react-native/
No. You can't build Android apps with this release.
Facebook has indicated that they are working on an Android version, and famously said "give us 6 months", which some people have taken as a promise. I wouldn't base any important business decisions on the illusion that it will be unveiled when the 6 months is over, but you can at least take some hope in the fact that they're serious about making it production-ready before they give us access to it, and that it's not just a pie-in-the-sky hope.
Also, as others have pointed out, Facebook has already release apps that they've built with the Android version of React Native. So at least parts of it are ready for prime time.
UPDATE
Early support for React Native for Android has been pushed to GitHub!
As noted, there are several things that are currently not working if trying to port an application from iOS. But it's worth checking out.
https://github.com/facebook/react-native/commit/42eb5464fd8a65ed84b799de5d4dc225349449be
It is not aiming to be a cross platform, write-once run-anywhere, tool. It is aiming to be learn-once write-anywhere. -Colin Eberhardt, from Raywenderlich
Good news is that React Native for Android is finally here. (https://code.facebook.com/posts/1189117404435352)
while you can't do it right now, it shouldn't take that long.
The first React Native Android App has been published about two weeks ago in the play store as tweeted by the reactjs twitter account:
https://twitter.com/reactjs/status/615638361328349185
Great news! Now its possible!
"And so it happens, the commit we're waiting since about 6 months!" - usereact.com
Please read more on: http://www.reactnative.com/react-native-for-android/
Watch this video: https://www.youtube.com/watch?v=MNNR01NF290
I've tried out Facebook react native on Android and it really worked.
Simple Ubuntu install guide can be found here
Simple js files: link
Yes , We can now developed android apps too in react-native.
and some of the apps are already developed in react-native for android
suchs as:
1)F8
2)Facebook ads manager
3)Squad
4)Discovery VR
5)Ziliun etc..
and many more still counting.
Developers from around the world now opting react-native for mobile app development because of easy of use of JSX syntax.
and also it is commonly noted as simply the V in MVC.
Since React makes no assumptions about the rest of your technology stack, it's easily embeddable within an existing non-React Native app.
TLDR; Yes,
Detailed answer (As of November 2017)
React Native android application development is very stable and a good number of Android applications have been already built and used in production using React-Native.
You can find a showcase of applications here. Most of them have both IOS and Android versions.
You can also easily integrate your native Android java code to react-native. Refer here
As a developer who is building Android app using react-native with a lot of native java code dependencies, react-native runs stable and I found the documentation and community support is adequate.
Yes, it works for both the platforms ios and android, be sure to mention code entry points in app.js if it uses different code for different platforms. However native functions like native events or location manager need to be coded in native languages and then exported using RCT_EXPORT, you can find more about it in the docs
Sure,
Using React Native you can build real mobile app. real app means close to platform or simply can say 99% native app.react native provide easy way for building native android app using javascript for lucrative design.You have basic knowledge of android studio and error fixing in android studio related native module integration and good understanding of react.js then you can build android app using react native.
Basic Requirement for android app
1. Configure android studio please follow below link and avoid installation of python.
https://facebook.github.io/react-native/docs/getting-started .
2. for UI you will learn flex-box from official documentation.
I thing that is enough
Yes, not just with android but also with iOS using XCode
Yes, you can make real-world mob application with React-Native. React-Native is used to create a hybrid mobile application. In this, we write code in javascript which gets converted to swift for ios and java for android.
Yes, You can build the Android app using React Native. For this, you have to install Android Studio with all the required SDKs. You can run your React Native app in Android simulator by using Android Studio and command line both.
For command line, run the following command:
react-native run-android
Otherwise you can open the android project in Android Studio which is created by React Native in android folder and run the project from there.
Happy Coding.. :)
Yes, you can definitely build android apps using react-native.This is one of the great benefits of React Native. Before Facebook created it, you had to build your app twice and with different code : one for iOS using Swift or Objective-C and one for Android using Java or Kotlin.

How to embed jars to make them usable in Xamarin cross-platform App

I am trying to port my Android Application, developed with Google Android ADT, in Xamarin to make it cross-platform and runnable on iOS devices.
I am ready to translate the needed code from Java to C# but I don't know the best way to manage external libraries.
I am using 3 jars in my App:
android-support-v4.jar
mysql-connector-java-3.0.17-ga-bin.jar
YouTubeAndroidPlayerApi.jar
I tried to embed them following these instructions:
http://docs.xamarin.com/guides/android/advanced_topics/java_integration_overview/binding_a_java_library_%28.jar%29
but I'm getting some compilation errors. Here's one of them:
'Com.Mysql.Jdbc.Util' in '[..]\AndroidHelloWorld\JavaBindingLibrary\obj\Release\generated\src\Com.Mysql.Jdbc.Util.cs'
is in conflict with
'Com.Mysql.Jdbc.Util' in '[..]\AndroidHelloWorld\JavaBindingLibrary\obj\Release\generated\src\Com.Mysql.Jdbc.Util.BaseBugReport.cs'
I don't know if it's worth going on trying to fix the errors or it's better to use native libraries for iOS.
As you'll have separate projects for each platform, I would just use the appropriate jars, as there can be differences in the way Youtube works, for example, that would make the android jar unusable in an iOS project.
But about the errors you encountered, it's worth reading this link thoroughly.
You won't be able to use any of your Android specific code or libraries on iOS.
You have two basic options for cross platform development, to create a Xamarin Forms project or create a iOS, Android and Shared project.
If you decide to go with Xamarin Forms you will need to:
* Extract your platform independent code into a shared PCL project
* Redevelop your front end in Xamarin Forms
If you decide to go with separate projects you will need to:
* Extract your platform independent code into a shared PCL project
* Develop an iOS front end project

phonegap for each platform should be created?

phonegap is cross-platform solution for mobile development. my question is for each platform i should create new project with phonegap and import my html/js/css? or there is a tool to generate other platforms code?
As I know there is no tool for that.
You have to use the project templates for all devices you want to support and share the "www" folder for all the projects.
The main problem with this approach is that you have to implement all changes in the native code for each device... for example we had to change the start page in our project.
edit
Thank you for the hint #PeterMmm, did not know this =)
As #PeterMmm has mentioned, the PhoneGap build service allows you to build for all the supported platforms "in the cloud". Currently it does not support custom plugins although I understand that is a planned feature.
So as long as you are using only stock PhoneGap API calls you should be OK to use the build service.

Categories

Resources