I'm trying to retrieve the most accurate geolocation of a user, which is using a java app and i haven't found anyway to access the location property, i've seen apps on the store doing it but i want to do it from a java app
what i have tried is creating a UWP class lib with visual studio and putting static methods inside, and then i thought of using jni4net to invoke it from java but i wasn't able to compile the dll
isn't there anyway to interact with the windows runtime from java, and how would i access the gps location by any other way
after lots of researches, i have found something that answers my needs but is not a perfect solution.
i have created a C# console app and had it retrieves the geolocation using the System.Device.Location API and prints it to the console, and then compiled it into an exe and packed the exe with my libs.
the java app runs the exe and gets its output and uses it as it pleases, the only problem is that the C# console app can't enable the lcoation so if the location is off the user will have to enable it manually, i hope this approach helps someone.
Related
So I am writing code in java in google colab because I want to copy-paste the code in android studio to perform a specific function. Now in python it is pretty easy to upload files to google colab but I want to do it in java (I particularly want to upload image files). I should be able to upload image files in such a way that I can use it as input in my code. How can I do it? Also, for all the packages that I import in google colab, will I have to separately download them for android studio or can I just copy-paste the code and it will run?
Google Colab presents a Jupyter-notebook like environment for Python code only. It cannot run Java code (at least, I cannot find where you'd make it do that).
I want to copy-paste the code in android studio to perform a specific function
Android code runs on an Android device, not in a server.
If you want to run Java code on a server, then you'd host an HTTP-based Java web-server that you use an HTTP Client from Android app to communicate with it. (In theory, yes, you can install and run JAR files in Colab, but you would then need to know the IP of those servers in order to connect with them).
The more appropriate solution would be to use Google AppEngine or GCE/GKE (assuming you want to use Google Cloud)
I ... want to upload image files
You can use the Java Google Drive SDK for that
for all the packages that I import in google colab, will I have to separately download them for android studio
Android Studio is an IDE. Gradle will download packages for compiling your Java/Android code, yes, but as mentioned, Colab is downloading Python packages, not Java
I am trying to call up a user defined matlab function(.m file) from java android application which is developed in Eclipse using matlabcontrol.jar.
Actually, It works well when I use it in the java project.
But I wonder is it possible to use it when I develop android application.
The problem is When I use matlabcontrol.jar for java project, it pops up and runs matlab application(like R2009b matlab) automatically, even though I don't want to use it. then run and print result on the matlab console also.
Then, I think, if someone who didn't install matlab application in their computer or smartphone can't use application which is included matlab code.
So, I just want to run matlab code on java program(for android), not using matlab application. Give me option or alternative way to work out please?
Please help.
Thanks.
matlabcontrol just gives you a way to call a running copy of MATLAB from Java. If you have some MATLAB code that you want to run on an Android device, this is not going to work for you, as there is no version of MATLAB that will run on Android.
If you have MATLAB code that you'd like to run as part of an Android application, you have two real choices:
i) Use MATLAB Coder to convert the MATLAB algorithm to C code, that can be compiled, called from Java, and included in your app to run on the device. You'll need to ensure that your MATLAB algorithm falls within the subset of the MATLAB language that is supported by MATLAB Coder, but that usually isn't a big issue. MathWorks have a recorded webinar with a worked example of how to do this (it's Objective C on iPhone rather than Java on Android, but the principles are the same). It's called something like "MATLAB to iPhone made easy", if you want to look it up. Here's the link to it.
ii) Use either MATLAB Builder NE for .NET, or MATLAB Builder JA for Java to deploy your MATLAB algorithm as a web service, and have your Android application call that web service.
PS MATLAB Mobile is not a relevant option here - it is a tool for connecting to a MATLAB session on your machine or in the cloud, and interactively running MATLAB code. It does not give you a way of running MATLAB code on the device itself.
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 want to make one application that will monitor chat history of other IM in phone.
I couldn't find any Skype API for Android, although I found Skype4Java API from net. I wish to use this in an Android application. I have imported the .jar file of that API to my Java build path. When I run my code, I am getting errors for libskype.jnilib and libskype.so file.
I also can't delete that file also, because when I attempt to delete that I get an error. Please tell how to do that?
How can I use Skype's Java API inside an Android app?
As of the current writing of this answer, there is no Android implementation of Skype. There are numerous third-party chat APIs, although I personally can't name one since I haven't worked with any.
The reason why the Skype4Java API is throwing errors at you is because it was not designed for use with Android. To delete the .jar file, you must remove all references to it and remove it from your build path for attempting a delete.
I got this J2ME application (5ud0ku.jar) and I want to let it run on the PC with just a single JAR file (while using the JSE).
I tried using microemu, but I can't seem to get it work.
Also can the emulator be without the fake phone UI?
I have found pstros to be rather nice for running JavaME stuff on Desktop computers, and it doesn't give you the fake phone UI.
http://www.volny.cz/molej/pstros/