Possible to use subset of AOSP platform codebase? - android

I don't know if this question fits with SO's question guidelines.
We are a small media company, that specialises in customising Android to add extra sounds effects to the AOSP platform code. We do this by modifying the AOSP's frameworks/av/media C++ code, and adding Java and resource code to packages/apps/Settings.
We work with several Android phone manufacturers in Asia. The problem that we encounter is that these companies are reluctant to give us a copy of their customised AOSP codebase, which is understandable, given their investment in IP. I was wondering if we could use the standard Google AOSP, plus a subset of the manufacturer's customisations, such as drivers and their precompiled libraries, to allow us to integrate out software locally onto their phone, and test this software locally before on-site integration / acceptance testing. Now we have to perform the integration on-site with no prior preparation, with the resulting last-minute problems and stress.
Is this possible?
Paul

Related

How can one use an USB OTG serial interface on Android, in Qt?

I intend to port a Qt desktop application to Android. It uses QSerialPort to communicate with an external device (which has a built-in CP210x)
The application, although written purely in Qt and C++, runs fine on Android, but it doesn't see the device. The CP210x official driver download page recommends to compile the kernel on Android from source, which is not feasible to expect from the average customer. Other recommendations I found online recommend jailbraking the phone, which also isn't something we could expect end users to do.
There are scant few questions in this topic on the Qt forums, most saying that QSerialPort's Android support is quite limited. However, these topics are often at least 6-7 years old.
An Android developer forum/wiki/tutorial? recommends to use "Android Things", whatever it is. I couldn't find any apps fitting that description.
I know that it's physically possible to use serial-usb on an non-jailbroken Android, as I tried out a serial console app and it worked, I could successfully exchange data with my device.
Does this mean that the only was is to develop my own wrapper in Java, and use JNIEXPORT? That would break the easy multi-platform compilation I used before (just selecting a different kit from Qt Creator) Are there any simpler ways to accomplish this? Is USB OTG usage so low that no one else thought to implement anything in this regard?
QSerialPort has only a non-official partial Android Support (see https://wiki.qt.io/Qt_Serial_Port).
(... Use on own risk, only for rooted devices, in which is it possible to get/set a permissions to the /dev/ttyXYZ nodes)
You can use JNI to get a FileDescriptor with permission and then use the libusb library in C++ to communicate with device.
But yes, it would break the easy multi-platform compilation.

How to develop Android app completely using python? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
The community reviewed whether to reopen this question 3 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I would like to develop a (rather simple) android app to be distributed via Play Store. I would like to do so completely in python. However, the online research hasn't quite enlightened me: most comments are either outdated (>1 year old, and I feel there might be better integration of python since then) or they talk about running python in android (e.g. here).
Therefore, I'm looking for information regarding the questions:
is it feasible to develop an App completely in python - and what are the tools to do so? (Is e.g. Kivy recommendable?)
if so: what are the best software environments to implement this? (I unsuccessfully tried using Android Studio but couldn't figure out a way to run python code there.)
I'm quite new to app development and would highly appreciate any leads of doing this in python rather than in Jave etc., which I don't know yet.
To answer your first question: yes it is feasible to develop an android application in pure python, in order to achieve this I suggest you use BeeWare, which is just a suite of python tools, that work together very well and they enable you to develop platform native applications in python.
checkout this video by the creator of BeeWare that perfectly explains and demonstrates it's application
How it works
Android's preferred language of implementation is Java - so if you want to write an Android application in Python, you need to have a way to run your Python code on a Java Virtual Machine. This is what VOC does. VOC is a transpiler - it takes Python source code, compiles it to CPython Bytecode, and then transpiles that bytecode into Java-compatible bytecode. The end result is that your Python source code files are compiled directly to a Java .class file, which can be packaged into an Android application.
VOC also allows you to access native Java objects as if they were Python objects, implement Java interfaces with Python classes, and subclass Java classes with Python classes. Using this, you can write an Android application directly against the native Android APIs.
Once you've written your native Android application, you can use Briefcase to package your Python code as an Android application.
Briefcase is a tool for converting a Python project into a standalone native application. You can package projects for:
Mac
Windows
Linux
iPhone/iPad
Android
AppleTV
tvOS.
You can check This native Android Tic Tac Toe app written in Python, using the BeeWare suite. on GitHub
in addition to the BeeWare tools, you'll need to have a JDK and Android SDK installed to test run your application.
and to answer your second question: a good environment can be anything you are comfortable with be it a text editor and a command line, or an IDE, if you're looking for a good python IDE I would suggest you try Pycharm, it has a community edition which is free, and it has a similar environment as android studio, due to to the fact that were made by the same company.
I hope this has been helpful
You could try BeeWare - as described on their website:
Write your apps in Python and release them on iOS, Android, Windows, MacOS, Linux, Web, and tvOS using rich, native user interfaces. One codebase. Multiple apps.
Gives you want you want now to write Android Apps in Python, plus has the advantage that you won't need to learn yet another framework in future if you end up also wanting to do something on one of the other listed platforms.
Here's the Tutorial for Android Apps.
Android, Python !
When I saw these two keywords together in your question, Kivy is the one which came to my mind first.
Before coming to native Android development in Java using Android Studio, I had tried Kivy. It just awesome. Here are a few advantage I could find out.
Simple to use
With a python basics, you won't have trouble learning it.
Good community
It's well documented and has a great, active community.
Cross platform.
You can develop thing for Android, iOS, Windows, Linux and even Raspberry Pi with this single framework.
Open source.
It is a free software
At least few of it's (Cross platform) competitors want you to pay a fee if you want a commercial license.
Accelerated graphics support
Kivy's graphics engine build over OpenGL ES 2 makes it suitable for softwares which require fast graphics rendering such as games.
Now coming into the next part of question, you can't use Android Studio IDE for Kivy. Here is a detailed guide for setting up the development environment.
There are two primary contenders for python apps on Android
Chaquopy
https://chaquo.com/chaquopy/
This integrates with the Android build system, it provides a Python API for all android features. To quote the site "The complete Android API and user interface toolkit are directly at your disposal."
Beeware (Toga widget toolkit)
https://pybee.org/
This provides a multi target transpiler, supports many targets such as Android and iOS. It uses a generic widget toolkit (toga) that maps to the host interface calls.
Which One?
Both are active projects and their github accounts shows a fair amount of recent activity.
Beeware Toga like all widget libraries is good for getting the basics out to multiple platforms. If you have basic designs, and a desire to expand to other platforms this should work out well for you.
On the other hand, Chaquopy is a much more precise in its mapping of the python API to Android. It also allows you to mix in Java, useful if you want to use existing code from other resources. If you have strict design targets, and predominantly want to target Android this is a much better resource.

Is there any single framework for writing iOS, Android (and even Windows Phone)? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I would like to have a cross platform framework as these platform solutions.
My application requires location service, socket programming, camera access and push notifications. So, the web app is not the way to go.... Is there any tools or framework to doing this? Thanks.
Because you want to access platform-specific features such as camera, GPS, notifications etc., you're going to need to call platform-specific API's.
As such, at least SOME of your app code will need to be platform dependent. However, there's a good chance that a majority of your app's code & logic can be shared across multiple platforms. I would STRONGLY recommend Mono as a great multi-platform development environment. On Windows & Windows Phone, your code will run in .NET. For Linux & OSX, you can use Mono. For Android & iOS, you can use Xamarin's tools.
The key here though is that if you package your app logic into "Portable Assemblies" (i.e. assemblies which take dependencies on parts of the .NET framework available across all implementations of the CLI/CLR), then your code can generally run without modification on Windows, Windows Phone, Linux, OSX, Android and iOS!
All you need to do then is build platform-specific shells that make your app look like a platform-native app using the typical controls and design metaphors of the various platforms you want to support.
HTH.
Update 2012-04-06: If you want to take advantage of Portable Libraries, here is some updated documentation on MSDN that refer to the newly updated version of Portable Libraries included in the recently released (and well-worth-a-look) Visual Studio 11 Beta.
Update 2012-04-11: A new article titled 'Create a Continuous Client Using Portable Class Libraries' was published in the March 2012 edition of the MSDN Magazine that illustrates how to use PL's to create an app for Windows Phone and Windows 8 that share the same core business logic.
http://phonegap.com/about is the best approximation I can provide.
If you're not looking at web-apps, you might want to take a look at codenameone. It's java based and they have a plugin for eclipse too.
The latest release of the Qt Framework (5.1) has what they call a "Technology Preview" of Android and iOS support. Fully released support will come in the soon to be released 5.2 version.
Given the extensive and successful history of Qt as a cross platform development framework I have high hopes for this. (Disclaimer: I have only used it for Win/Mac/Linux development so far...)
For native cross-platform framework, you should check out Crosslight. It currently supports apps development targeting iOS, Android, WP8 and Win8.
UPDATE: Crosslight includes built-in services that you're looking for, such as:
Camera Services: Taking photo from camera, browse photo from gallery, retrieve cropped image, produce either full or thumbnail version
Location Services: Get current location, get location by address, track location
Notification Services: Schedule local notification service
Connectivity Services: Check if an Uri is reachable, get current connection (WiFi or WWAN)
Many other useful services such as mail services, browser services, map services, etc.
Did you try Mono ?
You can try Sencha
Its a high-performance HTML5 mobile application framework. Works for iphone, android, etc.
Mono
Titanium
Refer to this Hybrid Mobile Application Framework.

Complete Android Operating System build for a specific hardware target

I'm going to try to rephrase and genericize these two questions:
Custom Android OS Build
https://stackoverflow.com/questions/2483631/custom-android-build-how-to
and add my own two cents.
A number of us have a need to build Android -- the complete operating system/stack -- and run that build on real, commercial hardware. Clearly this is possible since the various handset vendors do it themselves.
However, the instructions provided by Google ( http://source.android.com/source/initializing.html) only take you so far before you realize that, if you're not using one of the very few hardware platforms mentioned (unhelpfully on the very, very last page http://source.android.com/source/building.html), you are SOL. To wit, according to Google:
"[T]he Android Open-Source Project can't be used from pure source code only, and requires additional hardware-related proprietary libraries to run, specifically for hardware graphics acceleration"
Okay, fine (sort of). But Google does describe how that process works. The first ask is for guidance on building Android to run on real. (Indeed, how is it even possible for a non-handset-vendor to contribute to the Android OS without being able to build the OS and run it on hardware?) In particular, do said proprietary libraries need to be somehow extracted from the commercial binary and incorporated into the "custom" build?
Now, GPL requires mods to the kernel -- which could included drivers -- to be made available to the public and some vendors (HTC, Acer) make kernel source readily available. But it's not at all clear if this code is sufficient to do a runnable "custom" build. Further, even if that code is sufficient, the source tree from the vendor doesn't line up at all with the source tree from Google. So it's not obvious how to merge the files provided from the device vendor with the files from Google to do a build. So the second (third?) ask is how to merge the vendor code with the Google code to make a source tree that's buildable (and then build it) and runnable on an arbitrary hardware platform?
Anyone? Anyone?
The short answer to this question is that Google supports the Android Open-Source Platform (AOSP) on a very limited number of hardware platforms. This means that one cannot expect to build the unmodified AOSP source directly from Google and run it on an arbitrary hardware platform. Period.
The officially supported hardware is given here: http://source.android.com/source/building-devices.html At the time of this writing, there are only two 3GPP devices supported (officially) and no Qualcomm-powered devices supported. IMHO, this sort of makes a mockery of Google's "get involved" taunt given here: http://source.android.com/

Mono for iOS/Android Open or Closed? Paid or Free?

I am attempting to learn more about mobile/tablet development and, as a .NET developer, I am naturally drawn to Mono. But I am confused--I thought that Mono was free and open source; however, all signs seem to point to Mono being a "pay-to-play" deal (https://store.xamarin.com/).
Can someone please help me understand which is the correct answer?
Thanks!
Matt
Update (2016/03/31)
Mono has been re-licensed to MIT;
The Xamarin.iOS, Xamarin.Mac and Xamarin.Android SDK are going open source;
History answer
First let's clear up the Mono case :-)
Mono is free as in free speech, not free beer. You can get it for free (i.e. without paying) as it is available under open source licenses that allow this. But you could still pay for it too (e.g. people did pay for some versions of Mono in Novell's days). Also some people cannot use Mono under the free open source licenses (e.g. as a game engine where the source is not available...). In such cases a commercial license, from the copyright holders, is needed.
Mono for Android is a commercial product based on Mono and sold by Xamarin (who has the rights to license Mono). It re-use a lot of what Mono has achieved and also brings a lot more features to allow .NET developers to use their skills on the Android platforms.
Finally evaluation versions of Mono for Android are free and fully functional when used with the Android emulator (not with devices). So you can still try, learn and enjoy Mono and Mono for Android without paying a dime to Xamarin :-)
note: the same applies for MonoTouch which allows you to build .NET-based iPhone/iPad (iOS) applications from an Mac OSX computer.
Disclaimer: I work for Xamarin
As a long-time .Net developer (starting with 1.0), I can tell you that if you are anything other than a hobbyist, any money you spend on MonoTouch and MonoDroid will pay huge dividends in the very short term.
There is a certainly a learning curve for the UI and the third-party control environment isn't anywhere near as robust as it is for the Windows platforms, but the ability to program against the .Net framework (even if the language is C#) is an indescribable advantage and well worth every penny spent with Xamarin.
We were able to port a 500,000 line VB.Net application written for the Tablet OS and PocketPC to the iPad in less than 3 months, including local database support, web services interaction, etc. And it should take us less than another month to create the UI for Android now that we have a common services layer. At that point, we will have an application that will have similar functionality across iOS, Android, Windows desktop, Windows tablet, and Windows Phone. I certainly can't do that with the tens of thousands of dollars that I spend per year in the Microsoft ecosystem.
Old post, but poupou's answer needs some clarification and some additional information.
First of all, since Poupou's posting, Xamarin has added a new Community Edition license to the entire Mono/Android/iOS stack that allows for closed source distribution of apps, but this license is restricted to how large the binaries can be. In practice, even some Hello World applications exceed the community edition binary size limits, so in my opinion this is not a real option by any practical definition.
That being said, the core Mono runtime and runtime libraries are licensed under LGPL. This makes it difficult to release closed-source software in an app store using the mono runtime without purchasing a commercial license from Xamarin, but not impossible. One option that the LGPL allows, according to my understanding, is to provide the object files for your app. This would allow a user to re-link your app's object files to a different version of the mono runtime and then install that relinked app onto their device. They would still have access to the object files, but you could still keep your source closed if you wished. I'm not a lawyer, but I think you may be able to charge for these object files and distribute them by request only.
If you want to release an open source application using mono, you would be well positioned to do so because you can of course release not just the object code but the full source of your app, allowing users to relink mono into their own version of your app, and thus fulfilling the requirements of the LGPL.
Now, here's the problem. While what I said above is true, it ONLY applies to the core mono runtime. That's because the core mono runtime has an open source license. You might be surprised to know that none of the platform specific BINDINGS, which are the libraries and developer tools that Xamarin provides to hook up your .net mono code to, say, the platform UI/system libraries of android and iOS, are open source at all. So, Mono for Android and MonoTouch (and monomac?) are neither free as in free speech nor free as in free beer. They are both 100% commercial products. Now, I'm told you can request an open source compatible license privately, but your open source project must be pre-approved, which means you will not be able to take advantage of the object code option for a closed source project, and I don't know what kind of restrictions Xamarin would place on such a license (I suspect similar restrictions to the community edition).
EDIT: Correction to the above - Xamarin won't give you an open source compatible license for an open source project. Instead, they will give you (as in, the developer wanting to release a build of an open source app on one of the app stores), a free full Xamarin license if they can verify that your app is legitimately open source. This is still the commercial license (for one developer), and not an open source compatible license, so this license does not apply to any other developers who download the code for your project and build it. They will need to purchase their own Xamarin license to publish their version of the open source app.
What this means is that, the only way to take advantage of the LGPL object code option for closed source distribution (or, indeed, to release an LGPL compatible open source app without Xamarin's permission), you would need to write all of your own platform bindings to make it possible for your app to interact with the system or UI in any meaningful way. Koushik Dutta, from ClockworkMod, originally started such a project, at least for the android bindings, prior to Xamarin's release of Mono for Android. He abandoned the project after Xamarin's release, but the code is still available here:
https://github.com/koush/androidmono
If one were to create a set of android/iOS bindings for Mono and release them under a permissive open source license like MIT/X11, then apps could bypass Xamarin and release apps under the object file option for LGPL compliance (or just release the code, if it's an open source app).
Going one GIANT step further - if you look at the core mono licensing breakdown, you'll notice that only the core mono runtime and its libraries are licensed under LGPL. Almost all of the class libraries are already using a permissive license like MIT/X11 or else some form of Apache or MS-PL. That means that if, hypothetically, in addition to creating some permissive open source bindings for android/iOS, someone were to start from scratch and rewrite the core mono runtime and runtime libraries (all the LGPL'ed parts of mono) using a more permissive license, then that hypothetical version of mono (I call it "MonoLibre" when I daydream about it) could be embedded in a closed source app, for free, without releasing object files, open sourcing your app, paying Xamarin anything, or having to ask Xamarin for permission to distribute your open source app. Xamarin could continue to sell the "commercialized" mono runtime, but MonoLibre could continue to use all the same class libraries and even the same compiler.
Mono itself is free. That doesn't mean everything written with mono is free. As is the case for mono for android. Somebody took the time to write software that makes mono work with android. Just because it's written in mono doesn't mean they have to share it for free. The only thing they'd have to share is any changes the made to mono itself. Just because android is free and open, doesn't mean I can't make applications and require people purchase them in order to use them.
It's been a while since this questions was first asked but I did come across a completely open source option called Monocross http://monocross.net/
Haven't used it so I don't know how good it is.

Categories

Resources