Compiling the Settings app from the Android Source Code - android

Well I have always been puzzled by the android source code and how to compile it. By reading on stackoverflow and on other websites I have come to the idea that to compile it you have to pull the whole android tree and do the actual compile on linux.
I want to make some changes to the settings app from the android source code and compile it as a standalone application.
Reading and searching I came to the idea that it cannot be done since it has calls to nonpublic api. Although I have seen some posts which kind of suggested otherwise.
Is it possible to make changes and compile the Settings app as a standalone application ?
If so could you give me an idea on what direction I should go ?

Is it possible to make changes and compile the Settings app as a standalone application ?
In AOSP you can build separate modules, so the answer is you can build it. The problem is Settings app uses services that their code is located outside Settings app so you'll have to use sources compatible with your ROM. In addition, Settings app needs system permissions so you'll have to replace the original Settings app (it's will also avoid conflicts with original app).
If so could you give me an idea on what direction I should go
I'll move on with that direction only if you planning using a custom ROM. Then, I'll download its sources and compile Settings app. After I've validated my version is compatible with the ROM, I'll start updating Settings app with my changes.

Related

How to create a system app for custom ROM

We have a custom ROM for a device we are making and what I want to do is make our own custom Settings app to replace the settings app that comes already built in android.
I cant really find any documentation on how to even create a system app. It does not appear you can create it in Android Studio, I tried looking on the AOSP site and didnt find anything there related to creating system apps. The few things I did find were on here where you would put android:sharedUserId="android.uid.system" in your manifest and then has to be signed with the same key as the ROM but after that I cant find anything.
The settings app I want to create would need access to the framework.jar to be able to use the hidden framework API's.
Does anyone have any information or know where I can find this information on how to go about actually creating a system app?
You may want to research how to make a Device Tree Overlay (dto). Basically it is your code, reformatting the base code, into what you want. https://source.android.com/devices/architecture/dto?hl=en
Since you said you use Gradle, you should put first build you apk and put them in you vender folder, and next important thing is to create a mk/bp file to tell the Android build system how to deal with this pre-built apk.
P.S. If you system app highly depends on Android hidden api, make sure you have the right version of framework.jar in you Android Studio project, or, as what I alway did, create apps directly in AOSP, in this case, you can just check the code structure of the original Settings app in AOSP
this tutorial may help you.

Xamarin.Forms (UWP and Android) directory selection outside of AppData

I've been pulling my hair out all day. I'm converting my WPF app to Xamarin.Forms (UWP, IOS and Android). I'm currently focused on UWP and Android (don't have an apple devices yet) and I got a lot of the program running but I ran into a huge snag with reading files that are not in my sandbox directory. Currently, my app allows you to choose a folder with images and you can move through them. To test out the reading functionality, I've placed the images into the "LocalState" directory and bingo, my code is working beautifully. Now the program doesn't have a default folder and when I originally created it in WPF, the user would have a pop up and they would choose their own folder but I cannot for the life of me get a similar function for Xamarin. Every time I try something, I get an "access denied". I've seen Android apps allow you to pick a folder for emulators and I'm 100% sure that you can setup UWP to do permissions with StorageApplicationPermissions but I just cannot get this to work for Xamarin.Forms. Please help me!
OK, Android first it is easier. You need to setup in the manifest permissions to read and write SD-card. On Marshmallow and later you need to ask for the permission at the runtime (you need to do that from the native project).
On UWP the easiest thing to do would be to set the broadfileaccess in the manifest. Other than that you pointed out to the proper APIs, just you need to run them natively.
In general native code is called by using dependency injection. If it gets too complicated you may consider to create Xamarin.Forms project as a shared project where you can use conditional compiling instead of dependency injection which is quite simpler.

Change Editor.java class in Android Studio, Save, Run, Debug -> Possible?

In Android Studio I can change the Android API code and save it. I assume this change is not pushed to the emulator?
Do I need to download the whole AOSP and compile a new android.jar or is there an easier way to change for example Editor.java and try out things in Android Studio?
You probably don't want to change an Android api... you wouldn't be able to install the app on anyone's phone.
But yah, Android is open source and you can download AOSP, change an api, and compile a device image.That'd be the only way to do it.
What is your end goal here? There probably is an easier way to accomplish it.

How can I use whole android project inside a new android project

I have source code of indic-keyboard, and I want to use functionality of this project in my app, I have tried converting indic-project into a library, but that seems tough, so I am looking for some other workaround for this thing.
What can/have I try/tried-
I try to change "apply plugin: 'com.android.application'' to "apply plugin: 'com.android.library", then synced the gradle and got this some errors(check this issue), there I got confirmation developer of indic-keyboard that it will be tough to convert it into a library as this project is an input-method which relies on system settings.
So now I am thinking to use whole the project within my app, such that it will compile just after the installation of my app, but I am not sure where to start, I mean what things should I remove from build.gradle of indic-keyboard so that it stop generating apk, if somehow I am able to do that then it may not be that tough,I need just the idea how should I proceed, so if you have worked on these type of things then please provide your valuable suggestions.
*edit - I have also tried importing as module(suggested by zgc7009) but that produces error as shown in following images
The Indic Keyboard is already available on the play store, I would suggest to check at runtime if the user has that package (details here) and act accordingly: if the user has the package then fine, otherwise you can open the play store (details here)

Custom Android MMS/SMS application from source code?

Okay here's the deal:
I want to download the full source of the MMS/SMS application that ships with Android phones. I want to be able to modify it, and add a little custom functionality to it.
I am developing using Eclipse, and I'm on Windows 7. I have noticed that there is now a Git for Windows, but I am pretty lost in it and not sure how to integrate everything with Eclipse.
Basically, I want to just get it to the point where I have all the source code visible in Eclipse and be able to see the app run JUST like the built-in texting/MMS app that is already on my phone. Then I'll know that I can modify it and proceed.
Any ideas?
Thanks!
There's a mirror of the SMS/MMS app on GitHub here. Just import that to Eclipse and customise away.
Unless you want to customize and use it only on your own phone (without publishing), this is not a good idea. This is because it uses classes that are hidden from the sdk. By default you won't even be able to build the apk via eclipse, but there is a way. The reason why this is a bad idea is that the hidden apis are not guaranteed to remain the same through different api-levels and your app can stop working with the next android update, and might also not work on previous api-levels. In-fact your app might not even work on selected phones running the same api-level.

Categories

Resources