Android application launching from console - java

Is it possible to make a console Android app using the Android API? This application must be hidden in the package manager. Can you give me examples? In C++/Java.

Do you mean you want a console in Android so that you can type in java commands? If so, then no is the answer. Android does not have the option to use reflection. And reflection is needed to create a virtual machine where you can execute commands.

The NDK is a toolset that allows you to implement parts of your app
using native-code languages such as C and C++. For certain types of
apps, this can be helpful so you can reuse existing code libraries
written in these languages, but most apps do not need the Android NDK.
http://developer.android.com/tools/sdk/ndk/index.html
I think this is what you're looking for, but as the description says, make sure it's what you really need.

Related

Can an Android app be developed using C/C++? [duplicate]

Is it possible to make an Android application only in C++? I don't know Java. I've tried Visual Studio 2019 approach but I guess my computer isn't good enough for emulating Android phone.
You can write code for Android in C++, if you have the appropriate programming tools. You'll need a cross-compiler and linker for the appropriate architecture. These are readily available in Google's Native Development Kit:
https://developer.android.com/ndk/
I don't know if these tools can be used with Visual Studio -- I suspect it will be fiddly to set up.
The problem with programming in C or C++ for Android is that it's hard to integrate the application with the regular launcher and, even if you can do that, it's hard to provide a regular Android graphical user interface. Android simply does not provide a C API for the user interface.
I write/port a lot of command-line stuff for Android, so the lack of a graphical user interface doesn't bother me. However, most developers provide the user interface in Java and, if parts of the app needs to be in C or C++, it gets integrated with the app in the form of a native library.
Android Studio and similar tools know how to manage a project that has a mixture of C or C++ and Java code. Using well-established Android tools for developing complex, mixed-code apps like this is way simpler than trying to figure it all out yourself using a hodge-podge of tools from different places.

Is there any way to call python code in android develop without installing sl4a?

I have found some ways to using python to build android app.But all of them need to install sl4a and pythonforandroid.
It is so complicated,so is there any way to package sl4a to my android app project,and once I install the apk,I needn't install sl4a any more.
You can use Kivy at following link :
Python for Android
It will can help u have a look to the following topic :
How can I integrate a Python code in the Android Java app?
hope this help you.
You can do this. What it comes down to is packaging the Python interpreter (compiled by the NDK) in your app, and starting it via the standard NDK mechanisms. This is the same thing that e.g. Kivy does, but you'd be adding the code to your own app rather than (like Kivy) using a java bootstrap then letting the Python manage everything else.
One option, which has seen a little discussion/development recently, is to use python-for-android to build all the python components, then copy them into your java project (and add the code to handle it). This is possible, but not currently as easy as it could be, you'd need to look into how it works internally to get the outputs you need.
Another option that is probably easier right now if you don't need compiled code beyond python itself is to directly use the precompiled python binaries of the CrystaX NDK, in which case including the python binaries comes down to only adding them to your Android.mk. You'd still need some C and NDK code to interact with the interpreter, but the process is quite straightforward.
(SL4A has some Android build tools of its own, which you could also use for this, but I don't know what you'd need to do to integrate it as I think SL4A does extra things on top of just having the python interpreter present).

Porting Android code to BlackBerry naitivly

I am trying to port an Android application to BlackBerry 10 and make it look naitive. I have written all the QML for the app but I cannot seem to get the code to work. Do I need to translate the Java into C++ and if I do, do I have to do it manually or would an automatic one do?
Also my application has many different classes which I am not sure how to integrate with the BlackBerry layout.
I am trying to port the open source messenger Telegram, if that's any use. http://telegram.org/source/
Assuming you want to do a proper port and know C++ and Java, a full rewrite would be best. You can probably copy a lot of code from the Java source, but there's no way an automated converter or direct copy would ever work in C++.
Most of the processes in BlackBerry are the same as in Android, all you'd really need to do is rewrite all the UI code and handlers to fit the BlackBerry Native SDK

Using MonoDroid Library apk from Java code

If i created a apk library with monodroid. Can i u use this just in Eclispe(Java) and do my rest code in Java ?
In short: no. A DLL compiled from a Mono for Android class library relies on the Mono runtime in order to run it, which wouldn't be present in a normal Java Android application. It is possible to go in the other direction though, and use Java libraries within a Mono for Android app. Xamarin has documentation of how their architecture available here.
That said, in some cases it is possible to access C# code from Java code when you're in the scope of a Mono for Android application. This question/answer has some good details about that.

Is it possible to develop for Android on Android?

Lately I've been doing a lot of web development on my Droid via ssh using the ConnectBot app and a few other apps for reference. I've also been doing a lot of Android development back home in eclipse, and I wondered: would it be possible to develop and test my android projects right on my phone? All I can do at the moment is either write the code via ssh and then open it later with eclipse to finish it up, or remotely use eclipse via LogMeIn Ignition or VNC. Does anyone know a native way to do what I'm trying to do, preferably offline?
Try AIDE. I use it because it supports Eclipse projects. https://play.google.com/store/apps/details?id=com.aide.ui
Not sure if this hits the target you're looking for, but The Scripting Layer for Android (formerly known as the Android Scripting Environment) is available and has a lot of power available to it.
Scripting Layer for Android (SL4A,
formerly known as Android Scripting
Environment or ASE) brings scripting
languages to Android by allowing you
to edit and execute scripts and
interactive interpreters directly on
the Android device. These scripts have
access to many of the APIs available
to full-fledged Android applications,
but with a greatly simplified
interface that makes it easy to get
things done.
Scripts can be run interactively in a
terminal, in the background, or via
Locale. Python, Perl, JRuby, Lua,
BeanShell, JavaScript, Tcl, and shell
are currently supported, and we're
planning to add more. See the SL4A
Video Help playlist on YouTube for
various demonstrations of SL4A's
features.
I found DroidScript. It's a quite powerful JavaScript interpreter thats based on the Rhino-library. It can import every Java-package and even create activities for starting from the launcher. The URL is http://droidscript.se for the Live-Editor with which you can edit scripts online and send them to your phone, and the droidscript-app has an editor, too but it cant save at the moment, i think. DroidScript is Open-Source and embeddable in an own app, I think. More info on news of DroidScript are found on droidscript.blogspot.com.
check out JAVAIDEDROID on the market
You can if you have a remote linux machine that you normaly develop on.
ssh into the machine with some ssh app.
edit the code with some console text editor (vim for example).
build the application with ant
copy the generated apk into the android phone and install it
repeat from point 2.
Good luck!
I really don't know if it's possible, but to do it, you should:
"Install" java inside Android.
"Install" ant
run ant debug
Check this link for more instructions.
PS: Please let us know if you could do it :)

Categories

Resources