Real-time Android application - real-time-java

I would like to build an Android app that process acceleration data and return result every 0.5 seconds. Are there any way to deal with the problem with out using native code?
P/s: I'm a newbie so please go easy on me!

Currently, there is no official support for real-time Java on Android.
But, there has been some research/academic projects focusing on bringing real-time capabilies into the Android world, you should check out:
RTDroid: A Design for Real-Time Android
Non-Blocking Garbage Collection for Real-Time Android

Related

NativeScript limitations

I´m evaluating differents mobile frameworks, and I think that nativescript is a good option. But I don't know if exists limitations on the development process. For example I had limitations on the styling (and that's not so important), but I want to know if in the future I can have a limitation and can´t use some native feature or external library.
Thanks!
I have been using NativeScript since v0.90. I have written multiple apps and over 40 plugins for NativeScript, so I am very familiar with the ins and outs of the platforms.
This post is features as of v6.50.
I can think of only a couple limitations;
Tooling sometimes leaves a lot to be desired, however using the IDE's supported make this better than the Native CLI in a lot of cases.
Sometimes errors aren't always propagated back from the app to the screen/ide -- so you have to do things like "adb logcat" to see the full error log to see the error that got filtered out by the CLI.
Native Services (i.e. background services) --- This is much better written as native code. The NS runtimes take memory while running; so a service you typically want as small of a memory footprint as possible -- I would not use anything but Java/ObjC for a background service.
OpenGL on android needs to run in a separate thread, NS by default switches you back to the main thread when returning from any native calls; this basically kills direct NS opengl calls. However, it is actually better to create any OpenGL stuff in Java or Kotlin anyways; and then have NS call into your native code that handles all the rendering, so this is more of a minor annoyance.
Beyond that I can't think of any "real" limitations; you have full access to the native platform and can actually style any control as long as you know how to do it via native calls; if for some reason the control doesn't support the normal css styling. I & others have used many Android and iOS libraries in our apps. You can easily reuse native android/ios components you have full access to anything out there that is available to a native iOS or Android app.
You can look at https://plugins.nativescript.rocks for a list of all the plugins in the NativeScript community.
I have been developing with Nativescript for some time now, and while finished product (application) is more than decent, the process of development is really painful. The primary reason for that are frequent bugs in Nativescript platform itself, and it's official plugin for VSCode.
I am currently working on Nativescript 2.0.0 and have been trying to update to newer versions since they came out, but there were always some errors, ether with Node, or with Gradle for Android, and that is just one of many problem examples I face with the platform. I wish they improve it in the near future.
For now native apis are fully accessible from JS but if you want you can do some library in native languages and call them from JS code too, about external libraries it depends if you mean native libraries or JS ones, but there quite many options/plugins done in JS code using some native libraries but in case not as JS plugin you can do it yourself with native libraries
Community support is low compared to other frameworks available in the market. This should improve as people adopt the framework. I see that as a limitation for now.
And Yes, Debugging is indeed a limitation.
Nativescript is the best cross-platform solution in my opinion, but like the others stated there can be limitations. Besides background services, accessing the hardware CAN be a bit tricky. I have been using it to work with BLE devices though, and once you understand how to interact with native APIs, it isn't so bad.
I've written one NS app (core).
Some of the cons are:
performance - loading and also run-time. I'm replacing an Android native app with a NS app (because it's cross platform) and few customers have complained that the new app is slower and jerky...I agree.
bugs in NS core. I think that they've spreading themselves too thin. They need to get their core product stable and improve it (i.e. make it faster).
plug-ins varying quality with minimal support. Here NS could curate a few important plug-ins and make people pay for it.
Yes it's free - but that's not a huge issue for me - I'd prefer to pay for a more polished product.
At the end of the day - the product works - have my app in the app-store and look forward to future improvements.

How do you compare (ReactNative, NativeScript) to Xamarin?

Since [ReactNative/NativeScript] uses JavaScriptCore/V8 JIT interpreters and not compiling it so, is it strong enough for building all types of apps e.g. (Mediaplayer, Photo Editing, etc…)?
And how do you compare it with Xamarin?
I heard Xamarin uses AOT; is it similar to (JavaScriptCore/V8) JIT interpreters?
And how often Xamarin uses AOT for all of the app or it compile the part of code to native and uses AOT for rest of it?
Many Thanks in Advance.
Xamarin does AOT for its C# code, which will be run by open source port of .NET -Mono in non windows platforms like Android and iOS. Here are some limitations on Xamarin AOT
In comparison, Nativescript with Angular 2+ can take advantage of the Angular AOT for performance boot. More details here.
Here is a detailed comparison from Progress, the company that backs NativeScript and also provides UI elements for xamarin.
With more traction towards JS open source community, JavaScript virtual machine growth vs Mono for .NET, current benchmarks, I would bet on NativeScript/React native more than Xamarin.
NativeScript / React Native is a good bet, including your media player kind of app.. here is a sample you can give it a try.
Hope it helps.

Should I choose Xamarin native or Xamarin.Forms for existing Android app?

We have an android application and want to recreate it for cross platform.
What are the facts for or against Xamarin native and forms?
The advantage of native would be, we could reuse all the xml-layouts while we have to recreate the iOS view in either XAML or XIB?
Is there anything what is really a blocker?
I'll comment based on Giorgi's answer with some actual insight and refer to the copied bullet points:
This is a resume of the experience i've gathered in the past 6 months:
Xamarin.Forms is best for:
Apps that require little platform-specific functionality
Wrong. With DI you can use any device functionality you could possibly want. Check out XLabs on GitHub if you doubt this.
Apps where code sharing is more important than custom UI
Kind of nonsense really. You can write your own renderers to represent controls of each platform in the way you want. I've also written more difficult renderers for custom controls such as a SideDrawer. In android i was done in 2 days, iOS about 2 weeks (android renderer was just a wrapper for the native control)
Developers comfortable with XAML
well yeah and anyone who enjoys convenient UI development. Mind you that there is a learning curve with xaml (which i already knew at the time i started from WPF development). But from what i have seen it's not that different from android.
Xamarin.iOS & Xamarin.Android are best for:
Apps with interactions that require native behavior
While hacking your solution up natively is certainly faster you can instead be done rather quick if purchase good controls / know a good native implementation and mirror it in C#, since the API in C# is very similar to the native one.
Apps that use many platform-specific APIs
Not sure why Xamarin is doing anti advertisement against forms. I had little trouble with it so far
Apps where custom UI is more important than
code sharing
Probably true, but it's also harder to keep UI functionality inline and you will need more manpower.
Things to consider about forms:
Forms seems to be stabilizing at the moment and i am sure Microsoft will do their best to turn it into a solid, reliable product (build issues have been a nightmare in the past sometimes, but it has gotten better over time)
The XAML for Xamarin is less developed compared to WPF XAML, though very similar. Recent nuget updates however provide mirrored functionality at an impressive rate. The vast majority of features you expect and love about XAML are present.
List performance is bad if you don't do your research (here). Performance increased loads in that area.
If i had to make the choice again i'd still go for forms. While there are sometimes things which seem flawed / bad you can usually figure out a clean fix somehow, while spending most of your time actually developing the app. (sometimes you will still find things which just make you frown why something isn't implemented, like the Margin property being implemented only just after microsoft purchased xamarin)
If you end up having a requirement of nested lists, make sure to have a look at embeded native controls in order to achieve the maximum performance - this was essential for a product i was working at. See this
According to Xamarin.Forms main page:
Xamarin.Forms is best for:
Apps that require little platform-specific functionality
Apps where code sharing is more important than custom UI
Developers comfortable with XAML
Xamarin.iOS & Xamarin.Android are best for:
Apps with interactions that require native behavior
Apps that use many platform-specific APIs
Apps where custom UI is more important than code sharing
Giorgis answer is the right one, but since you added some more constraints here are my thoughts.
I would analyze the current app. How much code is business logic which can be shared? How customized is the UI, should it look more native or more the same and how will it change in the future? If you plan to change a lot in UI and platforms should look similar, it might be easier to switch to forms.
Also consider if are you planning to develop for Windows Phone? If yes, you might save a lot of time just for this third platform.
After all there is one thing which I would also keep in mind. Developing in Xamarin.Forms does not mean, you cannot develop native. It is just an additional framework. In worst case you can still do everything natively.
Personally I use Xamarin.iOS & Xamarin.Android with MvvmCross, that way I can keep full control of the native UI on each platform while maximizing code reuse.
From Xamarin website (who knows better than them?):
Xamarin.Forms is best for:
Data entry apps
Prototypes and proofs-of-concept
Apps that require little platform-specific functionality
Apps where code sharing is more important than custom UI
[https://developer.xamarin.com/guides/xamarin-forms/]
With Xamarin.Forms at runtime, each page and its controls are mapped to platform-specific native user interface elements.
With Native Xamarin.Android and Xamarin.iOS apps leverage platform-specific hardware acceleration, and are compiled for native performance. This can’t be achieved with solutions that interpret code at runtime.
"Xamarin.iOS - The best way to build native iOS apps."
Ship native app bundles on the App Store. Our Ahead-of-Time (AOT) compiler compiles Xamarin.iOS apps directly to native ARM assembly
code, meaning your app is a native platform binary.
Access any iOS API. We bring 100% of Apple’s iOS SDK to C#, enhancing Objective-C APIs with stronger types and .NET naming
conventions so you feel right at home.
Call existing Objective-C code from C#. Use your existing Objective-C code, frameworks, and custom controls in your Xamarin app
using our automatic binding generator.
Build WatchKit apps. Use Xamarin Studio or Visual Studio to build new Watch Apps, edit Watch user interfaces in the iOS Designer, and
debug Watch apps in the iOS Simulator.
Stay up-to-date with Apple. We released same-day support for iOS 5, iOS 6, iOS 7, and iOS 8 so your apps can take advantage of the
latest iOS features as soon as possible.
[https://www.xamarin.com/platform]
"Xamarin.Android - The best way to build native Android apps."
Ship native Android packages. Xamarin.Android uses just-in-time compilation for sophisticated runtime optimization of your app’s
performance, meaning your app is a native Android APK.
Access any Android API, including new form factors. We bring 100% of Google’s Android APIs to C#, enhancing Java APIs with async support
and .NET naming conventions so you feel right at home.
Call existing Java code from C#. Use your existing Java code, frameworks, and custom controls in your Xamarin app using our
automatic binding generator.
Build Android Wear apps. With access to 100% API support for Android Wear, create full-featured applications capable of running on
Android Wear devices. Stay up-to-date with Android. Xamarin stays
up-to-date with the most current APIs from Google, so you can always
use the latest features in your apps.
[https://www.xamarin.com/platform]

Is Sending videos in chat supported in appcelerator

I want to make an app in which i would want to make a chat module and i want to add sending videos in that application, How ever i want to use appcelerator to build this mobile app as it might take considerably less amount of time , but i dont know if appcelerator supports such complex works
can some one please tell me if this is possible in titanium , some other modules inclde ,
android caleneder ,
complex ui
thanks in advance
Well... chat is not supported in Appcelerator - not because it's not possible, but because it's not a native UI control. Appcelerator allows you to write apps using javascript that translates to NATIVE controls being displayed on the screen.
Appcelerator also allows you to write your own custom modules per platform (http://www.appcelerator.com/blog/2011/10/module-development-guide-reference-module-for-ios-and-android/) wither in java or objective-c.
If you want a chat - you can build one using native controls. Want to add pictures and video to it? up to you - you can.
Even in native java and obj-c you'd have to do it and there's no out-of-the-box solution.
Hope that answers your question.

Called unimplemented OpenGL ES API message on emulator

I'm developing an Android application for Android 2.2.
When I run a program that uses OpenGL ES 2.0 on emulator I get the following error:
called unimplemented OpenGL ES API
But if I run the same program on a physical device with Android 2.2 it works perfectly.
What's happening?
Thanks.
Probably that you tried to do something that isn't implemented in the emulator.
Testing stuff on the Android emulator isn't a very nice experience for any kind of application, and for games or other real-time apps, or anything that uses multitouch, you should opt for testing on the device as much as possible anyway, IMHO. So not much lost there.
The emulator doesn't support OpenGL. You need to run and debug the application on a real Android device.

Resources