java - copy files from mobile device - java

I'd been trying to make this little desktop java application to backup some predefined files from an android tablet/smartphone to my computer.
Up to now I'd been using mainly the File.getRoots() function to reach every single drive with no trouble. I successfully tested this on two android phones, but the problem came when I tried it on a Galaxy Note. Unlike the first two. this device is not treated as "removable media" but as a "mobile device". Therefore, I can't reach it using my current method, it's just not "listed".
I'd also looked if there's a way to reach those mobile devices through cmd, hoping that helps, but haven't found anything usefull.
My goal is to backup just by plug > run-application > unplug.
So, that's it, i'm stuck! Any clue?
Thanks in advance :D

Related

Programmatically write to an android device

I would like to write a program in java that copies mp3 files from my PC, renames them so they sort correctly, and transfers them to the sdCard on my Android phone via USB. I assumed this would be a trivial task since I have already successfully written a similar program for transferring files to an external HDD, however I reached an immediate stumbling block. It seems that java (and indeed other desktop applications) cannot locate the device's file system even when given the exact path that windows explorer reports (This PC\SAMSUNG-SM-G900V\Card).
I've tried researching and the problem seems to have to do with the device being considered a Portable Device rather than a drive (maybe) but I have not found a concrete solution. An answer to the following question seems to suggest it is impossible but I find that hard to believe.
Can Android's internal memory be mapped to a drive letter on PC?
Does anyone know of a way to access Portable Device storage through java? If if it indeed impossible, can someone perhaps help me understand why it is possible through Windows Explorer but not through other programs.

Making an FPS counter for an Android app (having the .apk only)

I want to make an FPS counter for Android apps. While doing research I found a lot of examples for doing this when you have access to the source code of the app, since the counting is done in the main drawing loop.
The problem is I don't have the source code, I have only the .apk of the app so there is no way to modify it. My question is, how could this be done? (at least an idea to start with). And I am sure it can be done somehow, I've seen an app like this on Google Play.
Thanks!
I just installed the app.
At the beginning they ask for the activation of USB debugging on the device. And this why it needs a connection to the PC.
So this is how they are able to get such kind of information.
I would advise you to look at USB debugging of Android apps and see what is possible there (such as taking multiple screenshots per second)

How to run Java app in Android

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.

"One App" Android System

I created an Android app which communicates via USART with a µC in order to evaluate data. My co-workers and customers should use the tablet for only this purpose now. Is there any possibility to "hide" the Android OS or making it inaccessible?
Devices are rooted and I am willing to build custom ROMs (even though I do not have any experience with that yet). Are there any approaches available that I do not have to start from scratch?
Many thanks for your help.
Well. That what I'm trying to do !
The first thing I tried was to start the app just after the boot of the device (Quite easy with this).
Then, I get Android source code, and I hide the bottom bar using this code
The problem is, if your application is not stable ... you'll have some problem.
If you want to modify Android source code, the developper doc contains a very good tutorial to start !

The best way to play swf-files (flash) in my android-program?

I have to play flash (swf) in my program when the user clicks on a link. Which is best? Concentrate on android 2.2 and use the Adobe Flash Player, or what do you recommend? I have tested WebView, but can not play swf in the emulator. HTC has a custom flash player but it feel like a limitation.
Some code samples to play swf in android that works for as many users as possible?
Have you considered using Flash to create an AIR app for Android rather than using Java? If you have to download and run external swf files, this seems like a path of least resistance to me. Of course, this requires learning ActionScript, but it's not difficult if you know Java.
It's hard for me to give you a solid recommendation, much like toggy-tog-togs answer. B/c we don't know exactly how many swfs or what kind of swfs you are playing.
I mean, if your application is pretty much just playing swf's and you need a UI to run it, it might be worth looking at Air and Flex.
However, to address that first problem you had. I haven't tested it myself, but I am nearly 100% certain, that your emulator won't play flash content in a webview b/c you don't have flash player installed on the emulators. :-) Android supports Flash content but only after you download and install the player from the App store.
So you might want to try running your emulator and installing the Flash player app. I don't even know if that is possible but you ought to try it out. :-)
By the way, the Android emulator is trash, if you are serious about developing for the Android platform, you really have to pick up a device or two to debug on.
Good luck!
So your using JAVA if you are then it is best to open up the browser that is the easiest but if you are wanting to use it in the application (This is less loading time if it is included in the package) but it costs try using JFlashPlayer (It Costs For the full version) http://www.jpackages.com/jflashplayer/download/ This runs very fast on the android platform. Hope I could help.

Categories

Resources