Suppose I have a large existing native android application written in java. And now I have decided to make this application cross-platform using flutter technology. I know that I can implement flutter and rewrite the project on this technology in parts, but can I, for example, make a cross-platform activity on flutter and put native java code inside it
there isn't anything to convert and android native app to flutter but if you want your existing android application cross-platform you can use kotlin to make it hybrid https://kotlinlang.org/lp/mobile/
Related
Have anyone had the experience in using Flutter to make Android app that utilize the Android accessibility API?
Is this possible?
Yes it's possible of course since it's possible with native android you can use native channels for this
I have already built a plugin for interacting with accessibility service in android and he does the job you can read contents from the screen outside with it this is the plugin flutter_accessibility_service just check the example and instruction from the use
I am developing an app in flutter and I want to use an SDK which isn't available for flutter and they have a sample project which is written in java (android native) and I want to integrate that app to my current flutter app, is that possible to be done with platform channels?
My experience in the android native is very weak so I almost can pick up with that project.
Thanks in advance,
Yes, you can. It's your own app though, not another one. And it's not necessary, but Android Studio will help you.
You have to modify the /android project of your Flutter project. You need to implement the SDK in question, and copy/paste/refactor the relevant sample code. You can then expose this code to the Flutter side via a method channel. To learn how, read this doc.
Important : Hot Restart will not update native code. You have to recompile everytime you want to apply native code changes.
I'd like to develop a hybrid app using mgwt-phonegap.
I found this link :
What I don't get is: Why is he putting the gwt-code into the android project's folder? Isn't it unecessary to use Android at all when you use mgwt and phonegap? I thought, that was the whole idea behind it?
What do you get from creating an android project and then putting your gwt code inside it?
Can you use gwt to convert a standard android app into a hybrid app for different platforms?
I did not read the tutorial you mention, but with phonegap you can create a native shell, which is basically a WebView with some hooks to call native stuff, In this shell you place your HTML/Javascript which in your case is the compiled code of a mgwt project. The android project you create it with phonegap, their site has a tutorial, I think you should read more about phonegap.
I have a game written in C/C++ with SDL 2.0, I would like to port it to mobile platforms (specifically Android and maybe other platforms too). I read SDL has a native support for Android but the game itself is written for Windows at first, although no Windows-dependent libraries/code were used. As for Android, I only used the Java based SDK before and never integrated it with native code. Which changes (if any) do I have to make to the C/C++ so I could use it on Android platform? How exactly do I acually compile the whole thing to an APK? Is it possible to use Java and C/C++ for the application, I mean, the game's activity will be the native one but the other activities (menus, settings, etc) can be written with the regular Android Java SDK?
The Android README file in the SDL source release outlines most of what you need to know with regards to porting your SDL App to Android. There's also an example project for Eclipse that demonstrates you can modify to suit your needs.
https://hg.libsdl.org/SDL/file/d6a8fa507a45/README-android.txt
The iOS README file is also useful, namely for the sections on events and input, as much of it carries over to the Android port.
https://hg.libsdl.org/SDL/file/d6a8fa507a45/README-ios.txt
If you need help setting up the build environment, check out this (brief) tutorial which covers installing the ADK and NDK, SDL source, building a project, programming for Android and interfacing with Java.
http://www.dinomage.com/2013/01/howto-sdl-on-android/
http://www.dinomage.com/2013/05/howto-sdl-on-android-part-2-platform-details/
(1)
I dont know anything about SDL but as long as you only make calls suported by the android NDK and what ever android supported library it should be ok. I guess you would have to set up your tool chain such that it links with SDL for android?
(2)
Yes it is possible to call c++ (ndk) from the android sdk and vice versa (see 3)
(3+ rest)
See
https://developer.android.com/tools/sdk/ndk/index.html
If you download the NDK you can also see examples of how to compile with NDK to APK
I need to generate pulses to create a frequency from my android device (to communicate to arduino via the audio jack, but this is not important). Natively, java allows us to do that as explained here.
Unfortunately this is impossible to do via javascript, so I need to run this native code in my app through Javascript.
I'm a complete ignorant about "running Java from JS", so, can you suggest me a tutorial where to learn from, or help me somehow?
You need to write an Android plugin for this, Phonegap Android Plugin is the phonegap API documentation for writing a plugin. You need to call your Android Plugin through JavaScript.
Here is a Sample PhoneGap plugin for Android