Does Android Studio supports AngularJS for Android UI design? - android

I have a question about Android Studio: Does AS supports AngularJS code while designing XML files, e.g. for small animations or effects?

SUMMARY : NO
There is no way you can write Angular JS code while developing Android Native app. You can use Angular in a WebView (using js/html so), that's all.

AngularJS is a completely different technology than what is used in native Android apps. Native Android apps use Java and/or C for their code, which is compiled when you build the app. AngularJS is a framework for web development, running specifically on Javascript (a completely different technology than Java).
You can build apps without using native Java or C code, but there are tradeoffs. As noted in other answers, you can display webpage views as apps (using technologies like Cordova]), or use frameworks like React Native to write code in Javascript that then gets compiled to a native app. You could use AngluarJS in the webview instance, since it just displays a webpage, however not in something like React Native. I highly encourage you to check both of these (and other options) out, but keep in mind that they have their own limitations and tradeoffs – no one way is the "right" way to build an app.
In summary: No, AngularJS is a web technology, not a native app technology.

new answer = Yes... Sort of, you can do it with:
https://www.nativescript.org/
It translates javascript, angular and typescript code into native components!
Apparantly it's possible to use nativescript in Android Studio with:
https://docs.nativescript.org/runtimes/android/getting-started/hello-world

Android Does not support AngularJs. but still if you want to use you can use it in webview.

Related

using loadUrl()

It's been a few years since I've tried to create an Android application and since everything has moved away from Eclipse and now onto AS my old templates no longer work. I'm looking for tutorials that allow me to use my own custom html, css and Jquery, seeing as stuff like super.loadUrl("file:///android_asset/www/index.html"); don't seem to work anymore.
Are there any links or anything anyone can provide to get me started on creating non java dependant application?
If you want to make an app without using java you can start learning ionic framework https://ionicframework.com/
You can also go through Apache Cordova. It allows you to use standard web technologies such as HTML5, CSS3, and JavaScript for cross-platform development and you can also go with Xamarin that uses C# for cross-platform development.
You can also go through this tutorial for better understanding and for start learning from fresh :
Ionic tutorial https://www.youtube.com/watch?v=0jamhGf-8ww&list=PLYxzS__5yYQljbuGjaeugpqs9U07gS5P5
Cordova Tutorial https://www.youtube.com/watch?v=kqWZuEpHoSw&list=PLReL099Y5nRd9BNsMZwXvTDeqnfRMiGJy
Hope this will be helpful!!

Use react native to create a iOS framework and Android library (not app) from common code base

Has anyone had any success using react native to create both iOS and Android apps that can be used as libraries/sub-projects in other iOS and Android native projects that were created without react native? My goal is to create new functionality for an existing app that has both a iOS and Android codebase that was developed without react native.
As a simple example, lets image that I need to create a series of screens and logic to allow a user to 'create a new account'. Ideally I would like to create the new functionality (controller, views, api-client, etc.) using react native and then export it as a self contained iOS and Android app. In addition to being able to run these apps on their own, I would also like to be able to include them in other native iOS/Android projects as sub-projects. The native iOS project would then create a new storyboard/ViewController/segue(s) and link the main-view of the react native iOS App to it.
I know on iOS/xcode I can add a sub-project by drag-and-dropping an .xcodepro into another one. If I did this with a .xcodepro that was created with react native, how would I go about linking the top level view to the existing non-react native iOS project? Is there a similar process on the Android side to achieve the same functionality?
I would like to explore React Native as well. We have similar needs as you - to develop a common library/framework for iOS and Android. Our solution was to code the library in C++ and use it in XCode on iOS and through a JNI (Java Native Interface) converter on Android as well. The JNI is a pain as not everything translates 1 to 1. I researched using Ruby/RubyMotion but that also has a JNI conversion step. There are other languages that do not require a JNI conversion - but from my last read these are also eperimental. Trying all of these will require effort and results are not guaranteed. Assuming aside from the shared library you still want Native for the rest of the App (UI etc), this will require developers with a combination of Swift, React, and Java (which could get expensive) The approach that makes most sense would be to use Swift for the iOS framework and Kotlin for the Android library and use the same style (functional/react-swift/react-java style code) That way, while the libraries are still different, they are coded in the same style so development/maintenance effort on one can be quickly copied/applied to the other.

React native web-view vs Cordova

I have an app build using cordova. However, making it look properly on android is being a bit though. I read reac-native documentation and I thought about combining the current state of the app, embedding it on a web view and building the rest of the app using react-native.
The reason behind this is that I feel more comfortable building the android specific ui of the app (like sidebars, and menus) using react-native than cordova, and I want to know if this approach makes sense. Is react native web view as powerful as cordova? Does this make any sense?
Thanks and regards
Despite React Native owns a WebView component I believe that this component is not appropriate for your approach.
From the docs:
WebView renders web content in a native view. You can use this
component to navigate back and forth in the web view's history and
configure various properties for the web content.
The purpose of React Native WebView is simply "renders web content".
I believe that you can not simply put your current Cordova code inside a React Native Web View and "it works". If your current Cordova app is more than simple HTML pages and use some Cordova Plugin, for example, you will have problems at this point.
Added to this the fact that strange architecture will probably increase the maintenance cost.
And about React Native to be as powerful as Cordova: I would say that React Native is more promising and very powerful, but actually Cordova has a ecosystem more mature and consistent. Maybe you should take a look at NativeScript.
Is react native web view as powerful as Cordova?
Answer: It's more powerful than Cordova
Unlike Cordova/PhoneGap your code runs in a JS runtime on the OS, but the UI is rendered as native components. This makes it very different than Cordova/PhoneGap.
You can use the standard platform components such as UITabBar on iOS and Drawer on Android. This gives your app a consistent look and feel with the rest of the platform ecosystem, and keeps the quality bar high. These components are easily incorporated into your app using their React component counterparts, such as TabBarIOS and DrawerLayoutAndroid.
As for Cordova, you're bound to the limitations of the WebView.And since JavaScript is single threaded, you will at one point run into issues if there are too many things going on in your application code. Such as sluggish animations etc...

openCV with nativescript?

Is there any (easy) way to link to native libraries, specifically OpenCV, using Telerik NativeScript? I suppose since it outputs source I could go into the Android and ios projects after compiling and implement all of the openCV code seperately, but that sort of defeats the purpose of using NativeScript, imo.
Is there any cross-platform way to interface with native code?
Thanks!
If OpenCV supports Android and iOS then you would need to create the communication to the native code to use it. That's how all of NativeScript works, it allows you to use Javascript (TypeScript) and communicate directly to native code without any wrappers.
So essentially everything in NativeScript has a wrapper to the underlying native code/components, that's the difference and the power behind products like NativeScript and React Native as opposed to Cordova based apps (PhoneGap, Ionic, etc.).
Since your question isn't a code specific question, it's kind of hard to answer and there might be a slight misinterpretation on my part of what you are really trying to understand. Hope this helps in some way. :)
here is iOS pack for openCV:
https://sourceforge.net/projects/opencvlibrary/files/opencv-ios/3.4.3/opencv-3.4.3-ios-framework.zip/download
and for android you can download it from here:
https://sourceforge.net/projects/opencvlibrary/files/opencv-android/3.4.3/opencv-3.4.3-android-sdk.zip/download
EDITED:
a solution is to write a plugin and reference the OpenCV framework using cocoapods
here is the link of how to write a plugin in native script by cocoapods
NativeScriptUsingCocoapods

How to make a code portable?

I am developing an application on Android and this application will be transported on IOS.
My question is simple: how can I make a transportable code? Are there rules to simplify the copy of the code in another language?
Have you seen java2objc - a tool to convert Java code to ObjC code.
You can also try something like MonoTouch (for iPhone) and MonoDroid (for Android), which allows you to develop in .NET.
iOS applications are mostly written in Objective-C. Android applications are mostly written in Java. You can't copy the code into another language. You must port your Android Java code manually to Objective-C/Cocoa-touch. If your Android application is web based, you can simply re-use the same HTML in a webview. iOS and Android apps work differently and users expect a different experience, so understanding the differences will help you in creating easily ported code.

Categories

Resources