Applet - Which will read/modify system files and execute system commands - java

I'm a beginner with java applets. I have developed few small desktop applications using core java ( Swing ). I need to build an applet which can do the following things -
Read a system file and modify it.
Create system file.
Execute a system command for setting some configuration of the client machine
Applet will download a file by running a system command. I need to check for the file size and plot download speed in graph.
Applet should run on all platforms ( MAC OSX, Linux, Windows, Android, IOS )
I have already developed this app using python and PyQT which is platform independent. So my app can be run on all platform but that requires PyQT and some dependencies to be installed on all platforms which is a difficult job. So we are opting for java applet to avoid dependent package installation and give more user friendliness and make the application platform independent.
I have already gone through the following link -
http://docs.oracle.com/javase/tutorial/deployment/applet/security.html
According to this link I need a privileged applet to do system related activities.
My Questions are -
Is is at all a good idea to use applets for what I need to implement?
How to make applets privileged?
Does applets work on Android or iOS? AFAIK, JRE is not available for these two platforms.
Can I go for JNLP API? Is that platform independent? I found some examples here - http://pscode.org/jws/api.html#fs
Thanks

Is is at all a good idea to use applets for what I need to implement?
No. Applets are a PITA to develop or maintain.
Do as advised by MadProgrammer and use a stand alone application.
How to make applets privileged?
Digitally sign them, then encourage the user to click OK when prompted.
Does applets work on Android or iOS?
No.
Can I go for JNLP API? Is that platform independent?
The JNLP API is available to desktop apps. and applets running in JSE (so again not iOS or Android).
There is no x-plat language that can cover all required platforms. I'd use Java for desktops & Android API for Android phones. I don't know what iOS is programmed in.

Related

The need to sign a java desktop application

I provide a java based editor to in internal network of xml editors. Initially it was a plugin, changed to an Applet using jnlp to launch 6 years ago. With the eminent demise of web start I am changing the framework to a desktop Application. The Applet is signed and timestamped as required by all browsers. Once I transition to an installed java application I question whether I need to sign the application jars? The certificate is not cheap and the signing of 30+ jars takes a lot of time. The editor is used on Macs, Windoze and Linux systems. Do I still have to sign it to get it to run? If not what is the downside of not signing, vs the upside to signing?
Desktop java applications don't validate jar signatures. So there is absolutely no benefit to continue signing your jars. Applets are dead (and so is the "sandbox" security model).

How to capture fingerprint using HTML and VeriFinger?

I'm developing a system whose requires to capture user fingerprint. I have done this task using a desktop app in Java.
I need to do it via web using a form or dialog, but I have no idea how to do it. I want to avoid applets. Is there a way to place a button in HTML and capture a fingerprint?
I'm using verifinger sdk
UPDATE
I sent a message to Verifinger team and they sent me this:
Trial SDK package includes all the functionality, including VeriFinger Extended.
Before starting to implement these questions should be raised and answered:
Will your solution be able to interact with user's computer?
If you want your browser application to use client side fingerprint scanners and you want to use Neurotechnology components for it - you should write an applet (Java) or ActiveX component and then embed it to C# asp.net application (sorry we do not have sample for that). There are other ways of implementation but the applet is a general approach.
Will your solution be able to extract biometric templates on client side?
If you want your application to extract and/or do matching on client pc - you will have to use either an applet or ActiveX (in order to run code that references our libraries on clients pc). If you do not want to do that - you can capture an image (either with our components, or maybe just allowing client to select a file), upload it to the back-end (running C# ASP.NET, Java EE or even PHP), do processing there, return the results.
In general the Java Applet sample is a good place to start: you can use it for image capture and/or template extraction and write your own middleware (like enrollment to database or matching) on server (i.e. web services) and reference it from the client browser application.
SDK does include Abis sample java applet. It can be built with Maven running from command prompt this command: "mvn clean install -Papplet"
From SDK\samples\biometrics\java directory (if SDK 5.0 is used)
From SDK\samples\ (if SDK 4.5 is used)
Maven version 3.1.1 is recommended.
I hope it can be useful.
UPDATE 2
I did an applet which capture the fingerprints and passed them to a javascript function.
UPDATE 3
I released an example project to to this, explained in this post.
The Verifinger SDK contains components for creating stand-alone or web-based applications.
Available as a software development kit that allows development of stand-alone and Web-based solutions on Microsoft Windows, Linux, Mac OS X, iOS and Android platforms.

Running JAR on iPad/iPhone

I have a JAR (java application), which I want to run on my iPad. Is that possible, How to do this? If possible through Appstore, (I know the process of Appstore and I have Apple Appstore account), please let me know is it possible to upload jar in Appstore and download from there?
No, it's not possible to run jar file into iOS or upload to App store. but Oracle ADF Mobile uses a native container that runs applications on both iOS and Android from a single source base. One part of that native container is a headless/lightweight JVM, but it's definitely not a .jar file
http://java.dzone.com/articles/oracle-gets-java-running-ios
http://www.infoworld.com/t/java-programming/java-ios-just-keeps-getting-easier-204543
That's impossible. Apple doesn't support Java. Apple uses Objective-C as its main language. If I'm not mistaken, Safari on iOS doesn't support Java too so you can't run applet on iOS too.

Using Android libs on a desktop Java VM (like OpenJDK or OracleJDK)

I have never tried out the Android SDK and do not own an Android phone. However it seems that certain libraries are excellent, for example the text to speech lib. Is it possible to use this library with a desktop VM and did anybody here try this?
You could get the sources from android.git.kernel.org and try to rebuild them against a desktop environment, but it would be a lengthy project - you need not only the java stuff, but the underlying drivers, native libraries, customized c library, and add-on os functionality to support them.
The android SDK includes a qemu-based phone emulator in which most functionality works as on the device. This should be fine for playing with the capabilities, though is not something you would want to use to deploy them. There is also an x86 community build of android which people put on netbooks or run in virtualbox. Word is that the official android emulator may be moving to something similar since it's substantially faster to run x86 code on a customized os image in a vm than to emulate an arm processor.
There's also something of a simulator which tries to provide enough of the android o/s services to sort of run apps natively on the development machine without a vm, but the google folks have implied its a bit of a hack and not well maintained.

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