SDK has reduced api. - Android Q&A, Help & Troubleshooting

Please help.
I need repack android.jar
Yesterday i read android source codes and i realize that classes have more methods than casual sdk provide.
So
1.download android 2.2 rev 1.1
2.Unjar it
3.unjar android 2.2 rev 3 from sdk
4.Replace classes
5.repack to jar
6.rewrite android.jar in sdk folder
Some classes causes warning due to missing objects. So you can delete them or replace from default.
But i have problem with classes that does not been in native android.jar. eclipse see namespace of package but classes not.
Idea: because android.jar contain only empty stub classes. it is only compiler reference and eclipse use it only to know android api.
So is absolutely right add stub if they exist in android system.
Question: why android not support all api functions?
Is somewhere cookbook "how to"
Create own android.jar?
"Try google" is not answer.
Sent from my HTC Wildfire using XDA App

Explain in proper English

Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums & Read the Forum Rules
Moving to Q&A

Related

C++ Compiler for Android?

After googling this topic and finding nothing, I figured XDA was the place to go. I am looking for a way to get a C++ compiler working on my phone (mytouch slide) or android in general.
Thanks in advance
Que? Like a C++ compiler to compile for android? Why would u want this C++ don't run native on Android it must be called from java so it would be pointless.
There is an sdl port around that required zero knowledge of.java but I believe it still has to compile the java each time. If not it could be possible...
Sent from my Nexus One
I don't want to run the programs on my phone, just compile
Compile for what?
What is the Android NDK?
The Android NDK is a toolset that lets you embed components that make use of native code in your Android applications.
Android applications run in the Dalvik virtual machine. The NDK allows you to implement parts of your applications using native-code languages such as C and C++. This can provide benefits to certain classes of applications, in the form of reuse of existing code and in some cases increased speed.
The NDK provides:
* A set of tools and build files used to generate native code libraries from C and C++ sources
* A way to embed the corresponding native libraries into an application package file (.apk) that can be deployed on Android devices
* A set of native system headers and libraries that will be supported in all future versions of the Android platform, starting from Android 1.5
* Documentation, samples, and tutorials
The latest release of the NDK supports these ARM instruction sets:
* ARMv5TE (including Thumb-1 instructions)
* ARMv7-A (including Thumb-2 and VFPv3-D16 instructions, with optional support for NEON/VFPv3-D32 instructions)
Future releases of the NDK will also support:
* x86 instructions (see CPU-ARCH-ABIS.TXT for more information)
ARMv5TE machine code will run on all ARM-based Android devices. ARMv7-A will run only on devices such as the Verizon Droid or Google Nexus One that have a compatible CPU. The main difference between the two instruction sets is that ARMv7-A supports hardware FPU, Thumb-2, and NEON instructions. You can target either or both of the instruction sets — ARMv5TE is the default, but switching to ARMv7-A is as easy as adding a single line to the application's Application.mk file, without needing to change anything else in the file. You can also build for both architectures at the same time and have everything stored in the final .apk. For complete information is provided in the CPU-ARCH-ABIS.TXT in the NDK package.
The NDK provides stable headers for libc (the C library), libm (the Math library), OpenGL ES (3D graphics library), the JNI interface, and other libraries, as listed in the section below.
The NDK will not benefit most applications. As a developer, you will need to balance its benefits against its drawbacks; notably, using native code does not result in an automatic performance increase, but does always increase application complexity. Typical good candidates for the NDK are self-contained, CPU-intensive operations that don't allocate much memory, such as signal processing, physics simulation, and so on. Simply re-coding a method to run in C usually does not result in a large performance increase. The NDK can, however, can be an effective way to reuse a large corpus of existing C/C++ code.
Please note that the NDK does not enable you to develop native-only applications. Android's primary runtime remains the Dalvik virtual machine.
The ndk allows u to use c++ c/c++ code in Android. That code must be called from java tho.
Sent from my Nexus One
I don't think you guys are understanding his question... He's not looking to write apps for Android... he's writing stuff in C++ (presumably for desktop or maybe other embedded applications, I dunno) and just wants to be able to compile that code on his Android device...
Now as far as an answer to that question, they did kinda cover it... Since pretty much everything in Android runs in Java, I believe it would be pretty difficult to write a C++ compiler that could run on Android.
To install an compiler in your Android device, google around for how to install Debian in it. Don't be afraid, you install it in parallel of Android, you will need a command or terminal window as well (available in the marketplace).
Debian comes with everything you need to compile in your device.
I hope I was useful.
Cheers
Thank you abrigham for clearing that up for me. You are exactly correct.
Ernestus, that seems like it would cause more problems then it would be worth
hmm.. i was googling for this as well.. thought it'll be useful to have this around.
JDV28 said:
Thank you abrigham for clearing that up for me. You are exactly correct.
Ernestus, that seems like it would cause more problems then it would be worth
Click to expand...
Click to collapse
Next best option then is to cross-compile to Android/ARM from another platform. The arm-eabi toolchain provided by Google's NDK is one option as others have already mentioned.
Codesourcery ARM toolchain is another, for Linux i686 theres link to the downloadable archive see this post (search for 'wget THISLINK' text on that page).
- jc
If your looking to corss compile for android, check this link out.
http://teslacoilsw.com/dropbear
Installing debian isn't too bad, and would give you the most flexibility for compiling on the phone.
You could also ssh into another computer using connectbot or some other terminal and code/compile remotely.
Another way to do remote compiles is continuous integration. Edit/upload the file to your repository, and using a server such as Jenkins, run the compile and view the results through the browser or an app such as Hudson2Go. Jenkins will also auto-compile on edits and can send you a text if the build fails. Jenkins is very easy to setup.
Try finding an online c++ compiler or you could connect to a windows or linux machine/server to upload andcompile your c++ files.
JDV28 said:
After googling this topic and finding nothing, I figured XDA was the place to go. I am looking for a way to get a C++ compiler working on my phone (mytouch slide) or android in general.
Thanks in advance
Click to expand...
Click to collapse
Use "c4droid" this is a paid app.. anywy if you like search on the market.
Another alternitiv is out there now. Not sure how good it works.
C / C++ Compiler
im looking for compiler too i found i market a4droid compiler but it costs... and i couldnt find enywhere free apk
Easiest thing to do would be a chroot Linux environment from an existing distribution, like Ubuntu. Then compilers for nearly any language you can think of are an "apt-get install" away.
If you're running CyanogenMod 7, you have a large SD card, and you don't mind repartitioning the SD card and shaving off 2 GB or 4 GB for Linux, then I'll be posting a howto in the next day or two. I have Ubuntu 11.10 Oneiric Ocelot running out of /sd-ext cleanly, using only files from official sources (<32 MB file from cdimage.ubuntu.com and everything else via apt/dpkg with signature verification) rather than from rapidshare-like sites.
Or about a year ago there were instructions posted for unzipping a ~2 GB image containing an older version of Ubuntu downloaded from a filesharing site. You could do that if you have an immediate need.
you can download from my blog
http://dateno1.egloos.com/855501
it from https://market.android.com/details?id=com.n0n3m4.gcc4droid&feature=more_from_developer
it has some library problem but work well (i already compile few binary for my phone )
I think c4droid maches perfectly what you were looking for. I'm using it to work on my projects "on the road" and so far it works pretty well.
A little tricky to set up, since you need "gcc plugin for c4droid" but to choose g++ compiler, and builds are saved at "data/data/com.n0n2m3.c4droid/files/temp" or something like that...
There's another option, but you still have to pay: DroidEdit Pro. Perhaps better editor (didn't test it though) but without it's own compiler, you have to set up an external compiler from sftp server.

[Q]Java Compiler in Android

Is there any way to compile java applications in android?
i wanna write simple java applications like i do in ms-dos
"javac file.java, java file".
could somebody tell me if i can do it?
Meraklis56 said:
Is there any way to compile java applications in android?
i wanna write simple java applications like i do in ms-dos
"javac file.java, java file".
could somebody tell me if i can do it?
Click to expand...
Click to collapse
if you want to build an app of course you can but i don`t know if that`s so simple. depends on knowledge
but you can start here:
1. http://developer.android.com/sdk/index.html
2. http://www.eclipse.org/downloads/
3. you will need java too
are you sure i do this on my mobile?
if i got it,right this is how i make application in my pc,not in my xperia!
i want that, in my android
Meraklis56 said:
are you sure i do this on my mobile?
if i got it,right this is how i make application in my pc,not in my xperia!
i want that, in my android
Click to expand...
Click to collapse
ohhh you won`t specify
download terminal emulator from market and you will have access to shell through phone
well u cant , cause Android doesnt have a JVM , it has a Dalvik Virtual Machine, and its optmized for mobile aplications and for the hw of the device, but u can emulate some plataform, but if u want to compile just some java code, there some solutions in the forum like install ubuntu and compile there, but an aplications native for android is a lil' hard
edit---
you can read this, is very helpfull...
http://en.wikipedia.org/wiki/Dalvik_(software) Dalvik VM
http://developer.android.com/reference/java/lang/Compiler.html Compiler API ANDROID (u can use it =) in ur aplication)
installing/emulating ubuntu just for compiling java is a bit out of my limits!
i dont want to compile any crazy program, just some easy programs.
there is not other solution, than this?
java compilation on android device
I'm looking to do likewise for various reasons.
One is I live in a tent and the droid device consumes less power than my laptop.
Two is that I'm developing a platform that moves some 'programmer space' activities to user space. Though with java the later can normally be accomplished wo authoring any source or compiling by using introspection and object serialisation (granted an android based dx is needed here) there are use levels of the platform that afford source authoring and compilation.
Having said that as far as I can tell a javac for android is in order.
Thus: openjdk.java.net/groups/compiler/README.html
One needs to verify the source's class dependencies and see if the android vm (the dalvik vm really) implements those classes. If and where not either the compiler code needs to be modified to use dalvik implemented java classes or the dalvik vm extended to accommodate the additional classes, again if any, that the javac source uses.
The determination as to which direction to take need consider the effort involved
either way and the legalities of either way while noting that the dalvik vm is allready the subject of a lawsuit (see Controversy at en.m.wikipedia.org/wiki/Dalvik_(software) ).
Personnaly I'm leaning to modify the javac source if necessary as this
openjdk.java.net/legal/
doesn't look prohibitive in so long, I think, as the language specs are met or more simply.in so long as the modified to run on android javac produces the same results as the original.
If you're ready to get yor hands dirty (not all coding is drag and drop) here ya go
download.java.net/openjdk/jdk6/
Maybe we'll meet somewhere along the way.
Sp
I got ClassCycle and ran it on the classes that resulted from me compiling the javac sources
in the openjdk's langtools directory . These sources are a programatic interface to javac and
are said to be used at one's own risk.I had trouble compiling the 'actual' sources
but will try again.
Once I can make heads or tails of the ClassCycle report I can provide a list
of javac's class deps.
Why one might ask would is any of this class deps stuff needed?
Dx the Java bytecod+e and run it. Droid has a vm, should be ok.
The problem is that Dalvik, at least does not implment awt and swing. What this means is that there is no native implementation for those classes' bytecode to be runtime instantiated towards.
Likewise if there are javac class deps that the dalvik vm does not implement there will be no native implementation in those areas and the bytecode won't run.
Till I get the list,
Steve
Script Layer for Android
Meraklis56 said:
Is there any way to compile java applications in android?
i wanna write simple java applications like i do in ms-dos
"javac file.java, java file".
could somebody tell me if i can do it?
Click to expand...
Click to collapse
For rooted systems there is a way to run Ubuntu in the phone/tablet. I don't remember the details, just google for it. I only remember that you should use a VNC viewer to connect to the xserver running in your own system.
I don't know if you can access from that Ubuntu to the resources of your Android (sensors, GPS, camera, and so on).
If you want to be able to create small programs in an easy way for your Android and being able to access all sensors and peripherals of your phone you should consider using SL4A (Script Layer for Android).
It's a base scripting system. On top of it you can install Python, PHP, Bash. So you can write your own scripts using any text editor in the phone, and run it without using any computer in the process
java compilation on android device
A year later and:
JavaIDEDroid: http://code.google.com/p/java-ide-droid
AIDE: https://play.google.com/store/apps/details?id=com.aide.ui&hl=en
and probably others as well.

Eclipse setup for a single AOSP-CM java application

Preamble: I am a Java Android developer. I know the standard Android development flow.
I want to start developing for AOSP-CM. I follow the guide for import the whole Java source code in Eclipse, using the .classpath file provided with the source code. So I have a Java Project with all the source code, and I can browse and edit everything.
The next step is try to setup a single Android Project, for example the Phone Application, in order to use the ADT plugin feature like GUI graphical editor.
I want to edit Phone sources, build within Eclipse and above all use Eclipse Debugger.
It is possible? Where I can find a guide or tutorial ?
Sorry but I don't believe that nobody has addressed this problem.
How a CyanongenMod developer develop and build a single application? (please...don't reply with "vim" , "nano" or similar....not in the 21th century )

Help - How to build Android SDK

Hi,
I need to edit some java class files in Android SDK (Target: API 23) because i want to create custom feature for my app.
Do someone know how i can rebuild SDK?
Thanks

Android studio emulator engineering build

I'm looking for a Android studio emulator engineering GSI build so I can develop (debug) system apps that use android:sharedUserId="android.uid.system" on the manifest. Where can I download them and how do I create a AVD to be used in android studio ? I'm looking for Android 8 or 9.
xjpmauricio said:
I'm looking for a Android studio emulator engineering GSI build.........
Click to expand...
Click to collapse
All I did was Google "Android studio emulator engineering GSI" as reflected on the following link...
https://www.google.com/search?q=Android+studio+emulator+engineering+GSI
... and the very first result was to the following link...
https://source.android.com/setup/build/gsi
... and if you go to that link, and scroll down a bit, you'll see the category "Downloading GSIs" that provides you with what your looking for.
If it's not on that page, then it's not available (yet) but, It looks like it is available.
Good Luck!
~~~~~~~~~~~~~~~
UNLESS asked to do so, PLEASE don't PM me regarding support. Sent using The ClaRetoX Forum App on my Enigma Machine {aenigma = Latin for "Riddle" AND Nickname for "My Ex-Wife"}.
I had already looked at that page but the information is confusing. There's a page containing various userdebug builds for download for android pie:
https://ci.android.com/builds/branches/aosp-pie-gsi/grid?
There are three types of builds: eng, userdebug, and user; I'm looking for the eng type, which uses the platform test keys.
The other problem, is that if you follow one of the links you'll land on a artifacts page containing many files that can only be downloaded one by one: https://ci.android.com/builds/submitted/5467499/aosp_arm64-userdebug/latest/
I haven't found an engineering build, only userdebug and I have no ideia on how to download all the files in the artifacts page, but the main problem is that I found no instructions on how to setup an AVD that can be used on Android Studio and Windows 10.
xjpmauricio said:
I had already looked at that page but the information is confusing.........
Click to expand...
Click to collapse
Hmm... I've never, personally, looked into this using this type/specific avenue before myself.
I'm just thinking that, maybe/possibly, either @Qui Peccavit, @Droidriven or even @osm0sis may be able to provide a better answer/guidance to help you out with this.
I do wish you the best of luck with this!
~~~~~~~~~~~~~~~
UNLESS asked to do so, PLEASE don't PM me regarding support. Sent using The ClaRetoX Forum App on my Enigma Machine {aenigma = Latin for "Riddle" AND Nickname for "My Ex-Wife"}.
Out of my wheelhouse, unfortunately. @phhusson is the GSI master.
I think that userdebug builds built by ci.android.com are signed with AOSP test keys, so that's good enough for you?
I don't really know how to plug in Android Studio with it though, but I heard it's quite easy
@phhusson, I just confirmed that a userdebug build uses the platform test keys; I unpacked a system.img from a userdebug build, checked the SystemUI.apk certificate, using keytool -printcert and the SHA1 is: 27:19:6E:38:6B:87:5E:76:AD:F7:00:E7:EA:84:E4:C6:EE:E3:3D:FA (the sha1 from the google platform test keys)
So...all I need to know is, using these files: https://ci.android.com/builds/submitted/5467499/aosp_arm64-userdebug/latest/
How do I create a AVD that I can use on Android Studio in Windows ? Any ideias?
@phhusson, you were right: its easy to get a userdebug build signed with AOSP test keys, they are available for download on Android Studio in the AVD manager section:
Go to Tools > AVD Manager > + Create Virtual Device > Select Phone, Nexus 5X > Next > Select X86 Images > Select Pie, Api Level 28, ABI x86_64, Target Android 9.0. > Next, etc, download and install.
All builds signed with AOSP test keys are identified by having a target name of Android 9.0, Android 8.1, etc. If you select an image, look at the panel on the right; it should say Android Open Source Project, etc.
All of the other builds of target user are identified with Target "Android 9.0 (Google APi's)" or "Android 9.0 (Google Play)", etc, and those are signed with dev keys, not test keys.
Thanks.

Categories

Resources