Compile app from AOSP and sideload to phone - General Topics

Hey,
Is it possible to compile just one application from AOSP (Pixel Experience) and install it on the phone? Let's say I want to add my settings to the "Settings" app and modify the system through it - currently my internet is too slow to download the whole AOSP and my computer is too weak to compile the whole ROM by the end of the year.
If its possible - how can I do this and will I be able to use Android Studio to compile? Will I have correct syntax, code suggestion?
My rooted phone is Samsung A505FN/DS if its important.

Related

Adding APIs to Android: modifying SDK, system and kernel?

I'm sorry if this is a really basic question or has been answered elsewhere before, but I couldn't find how to do it after a lot of searching on this forum, so here goes:
I'm developing an app that requires advanced networking functionality, and am trying to modify the wifi driver on Android to expose a custom API to my Android app (in Eclipse/Java) that isn't part of the stock Android SDK. I've managed to successfully compile a new kernel with my driver modifications (on Nexus S/Jellybean) so that part's good, but I also need to add the API to the Android OS and SDK, recompile and flash them, and then get my Eclipse/Java project to compile and link against the custom version of Android I've built.
Does anyone know what the best way to add a custom API to Android is, or could they point me to a step by step guide if this has been answered before? In particular, once I've built a new version of the Android kernel, the system and the SDK and flashed the custom ROM that supports this API to my phone, how do I get Eclipse/Android apps that I write to link against my new API/modified SDK?
Thanks a lot!

List of jargon.

I keep getting bombarded with so many jargon on this forum. So this list is to help out the many noobs like me.
List of jargon:-
(Also to help other noobs like me, I am also including the ones whose meanings I have figured out. Pls feel free to correct me. I am a noob after all. )
[I have bolded the ones for which I need info.]
MOD - Short for MODified. This is a commonly used jargon in gaming and mobile.
CM - Cyanogen Mod - A modified version of Android with unique features.
AOSP - Android Open Source Project - The official Android which is the base for CM and is also used by the phone manufacturers.
FXP - Free Xperia Project (http://freexperiaproject.com) - A version of CM, specially maintained for Xperia phones.
CWM - Clock Work Mod - Used to provide Recovery mode.
Kernel - The lower part of the Android OS. Actually this is not part of Android. On stock phones, this provided by the phone manufacturers. This allows manufacturers to go wild about their hardware and use their proprietary hardware technologies w/o disclosing that to Android. Android needs a predetermined set of APIs from the kernel to work.
ROM - Traditionally ROM stood for Read Only Memory, which were only flashable once. However, in current context it is not like that. This is the Android OS we know. This interacts with the hardware via the kernel. All app and user managements is carried out by this.
GAPPS - Google APPS. Namely - Google Play, Gmail, etc.
MDPI - Phones with Medium DPI resolution. DPI is Dots Per Inch. So this denotes the screen pixel density. Note, screen density and screen size are independent concepts. MDPI is about 160dpi. This is the average.
JB - Jelly Bean - The latest version of Android. Android 4.1 and 4.2 (latest) are both versions of Jelly Bean.
ICS - Ice Cream Sandwich - Version 4.0.x of Android.
GB - Ginger Bread - Version 2.3.x of Android.
FC - Force Close - When an app hangs and closed forcibly or it crashes.
Kang - Means stolen. However, since open source codes cannot be "stolen", so in this context it becomes - unofficial.
AOKP - Android Open Kang Project - Similar to CM, this is another port of Android with many crazy features like you can customize the LED color based on notifications of your choosing.
Dalvik - Android has a built-in Java Virtual Machine which it uses to run the Apps. (The apps are coded in Java.) Dalvik is an Android port of SUN (now Oracle) JVM. This was the thing for which Oracle sued Google.
APK - This is the extension of the Android apps. This is a package (actually a zip file) with all the app related files.
Odex - A pre-optimized file in the app's APK which the Dalvik VM can directly run. See SO and this thread.
Deodex - APK packages have classes.dex file, which has all the Java classes needed to run the app. This is a deodex file. First time when the app is launched, Dalvik VM needs to parse this file and create an optimized version of it, which it runs. That file is kept inside Dalvik Cache. See SO and this thread.
Dalvik Cache - Contains the optimized versions of the deodex files. More info at - this thread.
Additional jargon lists and references:-
[Guide]What is HSPL, MAGLDR, cLK, and CWM, and how to install them.?
ASOP should be AOSP, the Android Open Source Project
You can add AOKP, the Android Open Kang Project
...You can add Kang, which basically means Unofficial
FC is Force Close, when an Android app crashes
Dalvik Cache, see this thread
You can add Odex and Deodex, see this thread.
post-mortem said:
ASOP should be AOSP, the Android Open Source Project
You can add AOKP, the Android Open Kang Project
...You can add Kang, which basically means Unofficial
FC is Force Close, when an Android app crashes
Dalvik Cache, see this thread
You can add Odex and Deodex, see this thread.
Click to expand...
Click to collapse
I got the full form of ASOP from Google but can you explain it? I am confused since I thought Android was already open source, so what exactly is Android Open Source Project?
Also pls provide a short description about Android Open Kang Project. Android with "Unicorn Bytes", doesn't quite explain it.
He's just saying switch the letters around you have ASOP and it should be AOSP
Kang in programming terms means stolen code, however as you cant really steal something that is open source it more refers to a 'fork' of the AOSP, i.e they copied the code
The Android open source project, is the completely open source and free to use version of Android, i.e without Google apps. It is run by Google however there are many people that contribute to it and it features open software stacks for a range of devices (nexus devices etc).
It is designed to be a base from which manufacturers, developers or anyone really can modify and build on, this is where the likes of CM take their base from/ But manufacturers (Sony, HTC etc) will also use this.
In other words 'Android' is the operating system, the 'Android open source project' is a completely open source and free version of Android. (Much like Chromium is the open source version of Chrome)
This could potentially be a very useful sticky. Other words which could be added are root, radio, bootloader, recovery, partition etc. Most of those can be found in the HD2 terms guide in my sig (I think).

Simple way to port "official" Android ROM (AOSP) to specific device

Hi,
AOSP (check: source.android.com) is where one can find kind of official source code of Android.
Then you download it, compile it - and you have ROM ready to be flushed.
1. Is it will work for any device?
or, and I guess this makes more sense-
2. One need to modify according to his device spec. some parameters in the code. For example somewhere in the files there is a file with code holding some constant SW parameter called something like "double CPU_HZ" and you need to type "=1500;" because this is correct for your device.
Is there a simple guide to all device specifc parameters (and where to find them in the code)? Because if so - anybody can Download->follow the guide, modify all params according to his device spec->compile->flush->you have clean Android OS ready to go.
Thanks,.

Someone can help me compile a custom kernel?

So I want to use an app called USB Keyboard, it turn your android device in and USB Mouse/Keyboard but to use this App I need a Custom Kernel.
Why I want it? I need to execute some commands on EFI Shell on Windows but I cant type Colon ( : ) and without that I cant do anything... Since it works even in BIOS/bootloader I decided to test if with this App using an Android device as USB Keyboard I could type Colon but the thing is that I am new to these things and I dont know how to compile the custom Kernel.
In the Github of the developer of this app.. he already compiled an Kernel for the Device Galaxy Tab 2.. since this custom Kernel is old I cant find the ROM that he used to test it (lineage-13.0-20171028-nightly-espresso3g), there is just Unnoficial ROMs and he used the Official Lineage ROM which Lineage team deleted all the builds..
Here is the Github link: https://github.com/pelya/android-keyboard-gadget
The patch to compile the kernel I think they are in the folder Patches according to this page (The app has been removed from Google Playstore): https://apkpure.com/br/usb-keyboard/remote.hid.keyboard.client
"Other devices - you will have to compile the kernel yourself, using this patch: https://github.com/pelya/android-keyboard-gadget/blob/master/kernel-3.4.patch"
Click to expand...
Click to collapse
Since the Kernel-3.4.patch link doesnt work I assume its in the Patches folder, generic_kernel_4.9.patch
Retr0= said:
So I want to use an app called USB Keyboard, it turn your android device in and USB Mouse/Keyboard but to use this App I need a Custom Kernel.
Why I want it? I need to execute some commands on EFI Shell on Windows but I cant type Colon ( : ) and without that I cant do anything... Since it works even in BIOS/bootloader I decided to test if with this App using an Android device as USB Keyboard I could type Colon but the thing is that I am new to these things and I dont know how to compile the custom Kernel.
In the Github of the developer of this app.. he already compiled an Kernel for the Device Galaxy Tab 2.. since this custom Kernel is old I cant find the ROM that he used to test it (lineage-13.0-20171028-nightly-espresso3g), there is just Unnoficial ROMs and he used the Official Lineage ROM which Lineage team deleted all the builds..
Here is the Github link: https://github.com/pelya/android-keyboard-gadget
The patch to compile the kernel I think they are in the folder Patches according to this page (The app has been removed from Google Playstore): https://apkpure.com/br/usb-keyboard/remote.hid.keyboard.client
Since the Kernel-3.4.patch link doesnt work I assume its in the Patches folder, generic_kernel_4.9.patch
Click to expand...
Click to collapse
Now, I am not an expert in all this but AFAIK, there was never an official Lineage OS build for tab 2. All the old CM roms were then rebuilt as Lineage OS roms with latest security and CM ones were discontinued. Please correct me if I am wrong.
TheDoctor46 said:
Now, I am not an expert in all this but AFAIK, there was never an official Lineage OS build for tab 2. All the old CM roms were then rebuilt as Lineage OS roms with latest security and CM ones were discontinued. Please correct me if I am wrong.
Click to expand...
Click to collapse
Maybe, I never installed Lineage OS on Tab2 in the past.. but I know that they supported Tab2 in their website but now its removed.
Retr0= said:
So I want to use an app called USB Keyboard, it turn your android device in and USB Mouse/Keyboard but to use this App I need a Custom Kernel.
Why I want it? I need to execute some commands on EFI Shell on Windows but I cant type Colon ( : ) and without that I cant do anything... Since it works even in BIOS/bootloader I decided to test if with this App using an Android device as USB Keyboard I could type Colon but the thing is that I am new to these things and I dont know how to compile the custom Kernel.
In the Github of the developer of this app.. he already compiled an Kernel for the Device Galaxy Tab 2.. since this custom Kernel is old I cant find the ROM that he used to test it (lineage-13.0-20171028-nightly-espresso3g), there is just Unnoficial ROMs and he used the Official Lineage ROM which Lineage team deleted all the builds..
Here is the Github link: https://github.com/pelya/android-keyboard-gadget
The patch to compile the kernel I think they are in the folder Patches according to this page (The app has been removed from Google Playstore): https://apkpure.com/br/usb-keyboard/remote.hid.keyboard.client
Since the Kernel-3.4.patch link doesnt work I assume its in the Patches folder, generic_kernel_4.9.patch
Click to expand...
Click to collapse
Download the kernel your ROM uses, add the patch, compile it, make a boot.img and flash it. Not that hard once you know how

Question attempt at learning how to compile TWRP for our device.

I am not an experienced dev, and only know enough to be dangerous. that said, i used twrpdtgen from https://github.com/twrpdtgen/twrpdtgen to generate what ought to be the berlna device tree with the necessary board files etc.
what do i have to do, specifically, to clone the twrp source via git/repo? can anybody here explain it like you realize i don't know what i am doing i'll figure git and repo out eventually, but this will go quicker if someone would enlighten me
which android version do i want to build twrp with? apparently 12.1 support isn't finished yet, so i should use 11 with aosp source?
note, for our deivce you need to use the script on upon boot.img as we've a/b format, grab from latest stock rom to gen yourself, or see attached. also, necessary to use WSL on windows with a linux distro, or a linux vm, python on windows will not work.
please feel free to use these if it furthers the cause of compiling twrp before i learn how to use git and repo and compile it.. hehe
I wanted to try my hand at this and start digging into git and repo. I got as far as getting all the files ready, setting up the tree where it needed to be, used ". build/envsetup.sh", then lunched with option 5, which is omni-berlna_eng, which is closest to the twrp minimal manifest build option.
After I lunch, the issue arrives with the fact that omni-berlna_eng uses a depreciated PRODUCT_STATIC_BOOT_CONTROL_HAL, whatever that means. So I tried using lunch option 2, which would be an aosp-arm64_eng, but that just gives me the error "#### failed to build some targets (1 seconds) ####".
As of now, I'm at a loss. I don't have the extra time to spend working on this to make it function, and I only get a few hours at a time to get a crack at it, but nothing seems to work.
Edit:
I should mention, this is my first attempt at anything android development. I got this phone as a secondary carry on and I've dirtyflashed Pixel Experience onto it using a method found for Moto G Power TONGA. Wanted to see if I could get TWRP running since dirty flashing killed my mms and calling services.

Categories

Resources