So I have a project done which I made in Eclipse, I have also exported it as a Android and somehow imported it in Android Studio, But when I run the program in Android studio, it will execute as Java. And what I want to do is to make it execute in a Android phone (Can also be in a simulator)
But I have not found any tutorials on how to do it and I really need to do it since the essay is ending soon. So I would appreciate all help!
If more info needed, Please, Just comment. I will be available here next 2 hours!
The process should be quite simple if you have already succeeded in importing the project into Android Studio.
If you are using a Mac the process is very simple. If you are using Windows then there is one additional step described below:
In the AndroidManifest.xml make sure you have android:debuggable="true.
If you are using an Android phone with API 4.0+ then go into the phone's Settings and click on About Phone seven times. This might seem like a strange thing to do but it unlocks the phone's developer options, which are hidden by default. On older phones just go to Settings -> Applications -> Development.
In the Developer options select to allow USB debugging.
Now, connect the phone to the computer using a USB cable. You will probably see a message on the phone asking you to authorise the computer for that phone.
Next, open Android Studio and run your application (using the green triangle in the top toolbar). If the arrow is greyed-out then then there was a problem importing or building the project.
Wait while the project builds. It isn't that obvious that the project is being built. The only indication might be that there is a small spinner. If the build process succeeds you will see a prompt to choose a device. Your phone should be listed there. If it isn't, try disconnecting the phone from the USB and reconnecting it.
Select your phone, click OK and away you go. The application should launch on the phone after a few seconds. If it doesn't, be patient sometimes it takes a while. If it still doesn't work, check back in Android Studio for any errors.
Windows Only: Windows requires the additional step of installing the phone's drivers. Details can be found here http://developer.android.com/tools/extras/oem-usb.html
Related
Is it possible to run java app (jar) in my android application? Because I need to create PDF, the problem is if I generate PDF in android, only can show with small image, if it contains large image in many pages, it will be error. So I think, I can generate PDF in java and then included to android app.
Concernig the mentiones app JBED:
Well honestly, I could not find any credible source for this tools JBED, so I would really be very cautious (e.g. who is the developer?)
In the manifestfile (in Androidmanifest.xml, where every app has to state what rights it needs to run, see How to view AndroidManifest.xml from APK file?) there are many rights mentioned (what could be necessary, as the app wants to run as an emulator), so a java application might want to send an SMS, record audio, take pictures and place calls -- so the emulator would need those rights as well.
But then the app also registers the "android.intent.action.BOOT_COMPLETED" event (i.e. autostart after boot) and this would go against every description of the tool.
Ah yeah and giveaway: The apk has a folder "certs" that has some (root-)certificates. But those are not the real certificates of the authorities, e.g. Versign. If one installs the app and by that those certificates the trust you might have in https-connections is lost because those who made the fake certificates can create own, false certificates that your phone would trust.
I assume (or am pretty sure) this is a spy tool, but I could be wrong. The (rare) testimonials that claim the tool ran perfectly will probably be the same person that posted the tool under a different name.
Andreas
You can import java Third-party libraries into Android app, follow the steps here.
I am not sure whether it will work,but just try.
If your program is a console program, the answer is yes.
Install Jvdroid from Google play. Click terminal and then write this command: java -jar YourJarFileName.jar
The simplest way would be to some install terminal emulator and then install java and then you can run java apps on standard java. You can even install full Linux distro with x server without rooting the phone, then connect to it from x client and you have Linux desktop on android. Once I've even installed eclipse for java development on it and everything worked. I tested this setup last time in 2014, but I'm pretty sure you can do this nowadays as well. The app with Linux I get from play store as well app for the x client. The app I used back then was "Debian no ROOT" or smthg like this. You need to check what's currently available to make this setup in Google Play store according to your android version and your preferences. Last time I've checked there was a lot of different tools for this kind of task. Lastly I've even successfully installed TF and keras on my android phone using terminal emulator.
You can use JBED. JBED is an .apk Android application which run java games and app on your android Device. JBED is a java android emulator, by using
this application we can install .JAR/.JAD/Java/J2ME/MIDP app on android phones.
You can do it quite easily as there are many ways to run java apps on android. Specific application called Java Emulators can do it quite easily.
These are four most popular java emulators for android viz, JBED, PhoneME, Jblend and NetMite. These are arranged in order of their preference. You can use phoneme for non rooted device, however if your device is rooted try any of the remaining three applications.
I have recently started programming for the Android platform. I have a simple application which I would like to email to someone so that they can execute the application and check how it works.
I am currently using the Emulator in the Android SDK to execute my application but the person who I am emailing it to does not have Android SDK and it would be a mission to send the whole project folder.
Is there any way that I can send just one file such as an .exe or something that would allow the recipient to execute the application to see how it works.
Thanks so much for your help in advance guys
The "exe" for android is called apk. I suggest you to look at this question. You'll need to build the apk and sign it in order to be able to run it.
If you just want to send it to a user for testing purposes, you can enable the setting in the target android device to allow "unknown sources" (I don't know the proper english name, as I don't have an english android here at the moment). You can find this in the app settings.
In your development environment look for the apk file created by eclipse. Then connect your smartphone to the pc and copy the apk over. Start up a file manager and click on the apk and it will install just like any other app.
If you want to deploy it properly, you have to sign it and probably follow the procedures from google. Since I don't have a fully deployable app yet, I can't say what the procedures is for that, but the google site is very helpfull on all aspects about android programming.
Check the "bin" folder in your project path. There you will have a .apk that you can share with your clients.
If they execute it in an Android mobile phone the application will be installed.
I'm currently working with Processing, and I would like to code an android app. I have succeeded in being able to launch may application in the android emulator, but I am not able to get it to launch on my Galaxy 2.0 tab. I click run device, but every time I do I get a message at the end that says "waiting for device to become available". I'm thinking that I may need to point Processing to my android tablet somehow. Any ideas as to what I'm doing wrong. I'm on Windows 7.
It means your device is not being detected in the eclipse debugger tool. Did you check in Tab "Developer Options", make sure USB debugging is enabled. please refer other links you may get answer.
Click here
Device not detected in Eclipse when connected with USB cable
The problem I'm trying to solve- I'm trying to get deep linking working, and testing it with Emulator. When clicking on posts, the links direct to the mobile web site. This is in the case of the user having permissions for the app, and the app is installed (on the emulator). In the Facebook app, it even acknowledges its out of date, but an upgrade (in app) crashes.
I also noticed that the Facebook app installed on the emulator is out of date (I installed it via adb install facebook.apk from github sdk).
SSO is working fine, and I have setup deeplinking effectively with iOS before (So I know how ti's supposed to work/test it, etc.). But the port to Android is being held back by this out of date 3rd party Facebook app. I'm assuming testing on device will solve it, because there the Facebook app will be the latest (which brings to mind- what if people haven't updated their android facebook app?).
My app settings:
I'd post code, but this seems to be pure integration and configuration issues.
Note: my app isn't published on Google Play, could that be the issue?
Also: maybe this is only testable on the device? My device is "in the mail" so trying to get this done with emulator as much as i can.
Update: Facebook told me that this requires the Facebook app 1.9.* which is not in the SDK. So, I got my hands on a device, and while I haven't solved it, at least the app bookmark functionality is working. Will update if/when I find the answer.
Update 11am: I finally got it to work!
I had to publish my app in the Play/Market.
Each time I tested, log out of FB-Android app, clear cache, and force stop. Acc.
to the documentation the bookmarks are cached. I also think the
facebook app-syncing occurs on launch, and never again. So if you
change anything in FB's app settings, you need to log out/clear
cache/stop for it to take in the fb android app.
Only one key worked, even though it says "hash" in the fb app settings, I think
my dev key was screwing things up. Double-confirm that your release
key is the same as the one listed in app settings.
The final secret sauce for me, was to turn off SSO and deeplinking, re-test
without anything set. Also, remove dev package from phone and
download from Play. (see: key mixups). then, I stepped back through
the configurations by first turning on SSO, testing, then turning on
the native deep linking.
Only works on real device, not emulator (unless you can get 1.9 installed on emulator, may work, did not go down that route to test)
Not sure if this matters, but it may: install app from Store/Play, not from Eclipse. Could be the key syncing thing.
I figured it out- involved doing the following:
I had to publish my app in the Play/Market.
Each time I tested, log out of FB-Android app, clear cache, and force stop. Acc. to the documentation the bookmarks are cached. I also think the facebook app-syncing occurs on launch, and never again. So if you change anything in FB's app settings, you need to log out/clear cache/stop for it to take in the fb android app.
Only one key worked, even though it says "hash" in the fb app settings, I think my dev key was screwing things up. Double-confirm that your release key is the same as the one listed in app settings.
The final secret sauce for me, was to turn off SSO and deeplinking, re-test without anything set. Also, remove dev package from phone and download from Play. (see: key mixups). then, I stepped back through the configurations by first turning on SSO, testing, then turning on the native deep linking.
Only works on real device, not emulator (unless you can get 1.9 installed on emulator, may work, did not go down that route to test)
Not sure if this matters, but it may: install app from Store/Play, not from Eclipse. Could be the key syncing thing.
Have you had a look at the troubleshooting tips for deep linking? (Sorry, have to ask.)
I'm wondering if perhaps the FB app on your device was not properly quit after the relevant setting changes.
I'm trying to write some apps using wikitude, and I'm having some problems running even the example.
I've put the sample ( BasicOpenARDemo ) that comes with the SDK inside eclipse and tried to run it, where I encountered the next error: "wikitude was not found on the system. Please press the ok-button to access the Android market and download wikitude."
First question- I don't understand- Why am I approached to download the utility when I have a standalone sample inside my eclipse? Doesn't the core files behind Wikitude come with the SDK or the sample itself?
The next question will be - after some googling, I've found that in order to install this "Android market" I need to follow the manual that comes in the 9th message in the next thread (the message that was written by ronni.rasmussen) -
http://forum.xda-developers.com/archive/index.php/t-529170.html
Well, I've followed it, and now when I try to press the OK button that comes after the "wikitude was not found on the system..." message, I get redirected to the Android market, where I find Wikitude, but when I try to download it- I get a "Download was unsuccessful. Please try again" error message. How do I fix that?
One more thing that I don't understand- How come it's written in this offline Android market that the available wikitude version is for android 1.5 and no longer maintained?
As you can see- I'm quite baffled here. Hope someone could clear this up for me.
I was with the exact same problem. The problem was that installing Wikitude from the market (following the link you provided) does not guarantee to have the system requirements supported in the virtual device, therefore it gives an error when you run the BasicOpenARDemo, if it let you install it at all.
The solution was creating an AVD with an GoogleAPI (it includes maps support, I used the level 10 API for Android 2.3.3, it didn't work for the level 8 API), adding the camera, accelerometer, compass, GPS, etc., support to the virtual device (I did this via Eclipse). Then I downloaded the .apk for Wikitude and installed it via command line (.adb).