Is it possible to convert or to just export an Android project from eclipse to run on a PC without an emulator (like .exe)?
Nope, that's not possible, since Android uses the Dalvik VM wich is inbuilt in every emulator. Deploying and .apk file in the emulator is the fastest and easiest way when having no device.
The Dalvik vm is a complete environment wich is not included (or sth) on windows:
Related
I got my android phone rooted and I'm aware that the / doesn't contain the familiar linux /.
Is there a java command? Where is it located? I don't find one in /system/bin.
Is there a java command?
No. Such a command isn't shipped with stock Android images.
Where is it located?
It shouldn't exist on filesystem. What makes you think it should be there?
I don't find one in /system/bin.
You might consider installing any Java programming app for Android to have JDK/JRE installed. In this case the command will be located in the app's sandbox, not /system/bin.
Android does not use Java at all, at runtime.
Android runs programs that have been written in the Java language. Those programs are not compiled to Java bytecodes and will not run on a JVM.
Android executes Dalvik bytecodes. Until somewhere around Android 4, it used a virtual machine called Dalvik, to execute these bytecodes. Now it uses fantastically more complex virtual machine called ART.
Sorry. No Java.
How Android Studio store informations about my PC or my IP?
Lets say that i compile and build an Android project in a PC and then transfer that project to another PC and run it there.
Do you think there is still some kind of catches or stored libraries that store my info of my old computer?
If running Linux, there is a folder inside each project called .idea all the information needed to migrate and run project in a new Andrioid Studio Environment is there.
Environment
Windows (x64) Host
Android 5.0 USB connected to the Windows machine
Un-rooted Samsung Galaxy 5
Use-case
Java APK Application
Native C++ executable packed as a raw resource part of the APK
Upon startup executable is to be ~extracted~ to a temp folder where it would execute
Questions/Discussion
Is the above use-case supported by the Android OS?
To the best of my knowledge, '/data/local/tmp' is not accessible to a running app ( but to shell & root ), Is there a directory where the file can be extracted too and executed? ( dir must have execution rights )
What would be the best approach to achieve the above mentioned?
Yes, you can do this. You will need to make sure that the native executable is for the appropriate target architecture (some type of ARM processor, usually).
But you shouldn't extract it to /data/local/tmp. You will need to extract it to /data/data/application.package.name/lib, which is a directory to which your app has read/write permissions.
There are more details in this question and its accepted answer. It looks as though you can have the executable extracted automatically for you if you name it as if it were a library file rather than a standalone executable.
I have a requirement, where I need to install the .apk files directly on my host PC, without the Android emulator. I want to install it directly on my Linux machine (x86 arch). I have a few noob questions with regard to the same:
How is an .apk file organized?
Is it just one big binary file?
In this case, if I am using a phone with an x86 atom processor, does this mean that there will be a separate Android market segment which hosts apps ported to the x86 arch?
Is it an archive consisting of executables? (something like .rpm or .deb).
If so, then what is the format of the archive?
If so, do they have different .apk files for different architectures (x86, ARM, etc.).
If not, then how is it orgranized?
What are the requirements to run the .apk file directly on my Linux PC running on x86 arch?
I do not have a very good background of Android and the .apk files, hence these questions.
Thanks and regards,
Hrishikesh Murali
You cannot install .apk files directly onto your PC. Even though Android uses the Linux kernel, the applications runs on a totally different platform. APK files are ZIP file formatted packages based on the JAR file format, with .apk file extensions. They hold all of that program's code (such as .dex files), resources, assets, certificates, and manifest file.
They run only on the Dalvik virtual machine.
Install Android OS on your PC, if you really want to run them from a computer.
You can use the ARChon to run apk in ubuntu:
Install the ARChon Runtime.
http::github.com/vladikoff/chromeos-apk/blob/master/archon.md
Open and enable the flag: chrome://flags/#enable-nacl,then restart Google-Chrome. (Important!)
Install existing android apps in the website or convert your favourite android apps by "Online APK-CRX Converter.
Drag and drop the Google-Chrome extensions into the chrome://extensions/ page in the browser and it will be installed in your browser. Enjor it!
An apk file is not an executable, it's just an archive file contaning all the resources and class files that are to be used by the application.
The apk is set to be unpacked and run by the Dalvik vm.
The elements that are contained inside the apk file are specifically designed and designated to be used in Android mobile phones and not a desktop PC running Linux. Though Android uses the Linux kernel, you definitely cannot run the apk file on a Linux machine, as you would an rpm or a deb file.
i have the following doubt:
i have read that android os is based on linux, and i imagine it may have the same structure that ubuntu (in terms of file configurations: /root, /dev, etc).
so, is it possible to run an application written in C in android? just as it is possible to do in ubuntu? if so, how can i do that?
also, how can i get access to the root files through an android application (written in java)? and how to get access to the behavior of the os (in terms of interruptions for example)?
thanks in advance for your answers.
gus
Basic answer: Running a C app on Android isn't supported, except through the Native Development Kit (NDK).
You can't get access to the root files except by rooting a phone.
You can get access to some OS behavior through the API. Basically, if it's not part of the API, you can't access it.
The Android OS is based on Linux, but it's an OS, not a windowing server like X or a desktop environment like Gnome or KDE.
You may run C and C++ code on android using NDK. You may use also QT framework. But code is runing in virtual machine named Davlik. Android have root acount , but it is default not available for user. Therefore, access to directory is dependend for chmod.
If you would like read about access to low level in android:
http://www.phrack.org/issues.html?issue=68&id=6
And about architecture this system:
https://developer.android.com/guide/basics/what-is-android.html
You can run programs using Runtime.exec. As an example, you can see Terminal IDE which runs many different programs including ssh, vim and bash. It's also open source so you can learn from the code. You will probably have to include the executable as a resource or asset and then copy to a local directory, grant execute permissions, then run with Runtime.exec. You still have limited user permissions as your app runs under a restricted account unless the device is rooted and you request root access.
an android smartphone/tablet works with an Arm cpu, not a x85. the architecture is different.
but you CAN run a C application in android if you cross compile it for arm linux. or you can use a c compiler inside android device. people ported c compiler to android. you can try C4DROID and in android market. but you can only run compiled program in system memory because of android permissions about sd card.