hi
what do i need to do in order to make my java app executable on a mobile (let's say Nokia Symbian for example) . Do all jar files run on mobiles???
is there a certain way of programmings am supposed to use ?? are there specific classes am supposed to use???
Do all jar files run on mobiles???
No
is there a certain way of programmings am supposed to use ??
Yes , you need to use j2me for specific MIDP CLDC platrofm . have a look here
are there specific classes am supposed to use???
You can use the classes available over the platform , alternatively you can also add the external library
Easy, seems like your about to have a stroke. Start reading some articles about getting started on J2ME, try these ones out:
Link 1
microjava.com
forum.nokia.com
You have to know, that depends on the your orientation of you application, not all applications runs in all cell phones, is like in computers, a Windows application won't work on Linux, unles you use a Virtualizer. My point is, start reading all the documentation you you cant, and take it slow.
Some OS's like Symbian Can run java package file i.e. .jar files.
And Android lacks that capability.
Phones with MDIP runs .jad files that is a Java app made using the J2ME API.
Android generate Dalvik Bytecode and run .apk packages on the phone.
Related
I read SO q&a about launch java as windows service wrappers, but can't find/choose product, suitable for my requirements :
Wrapper reads all java launch parameters from config file. In registry must be only commands to run wrapper itself - path to exe and maybe path to config. Always grant admin rights to change app parameters in registry is not comfortable.
Working dir and path to application also must be in config. I want to place all wrapper files deep into program, because user not intrested in it.
No dependencies(.net, python, etc). I don't want to extend requirements of my program.
Free for every windows OS, include win64.
Simple and lightweight. Size of my program with all 3rd party jars is 12Mbytes. I don't want to add 20Mbytes wrapper.
Automaticaly restart if app process dies.
Preferably single exe files for all windows platform.
I try and lookinkg throught different wrappers and tired a bit. Best suitable till now is:
jslwin (http://jslwin.sourceforge.net), but i don't know how mature it is(version 0.99). Also parameter lists in config is a bit complex(need to edit parameters quantity).
winrun4j (http://winrun4j.sourceforge.net), but i don't know how mature it is(version 0.45). Also it needs a special class for working as a service.
Also i try or look throught:
YAJWS (http://yajsw.sourceforge.net/) too big (30mb), can't make it work with custom files layout.
Advanced Installer (http://www.advancedinstaller.com) too big (50mb).
nssm (http://nssm.cc/) store launch parameters in registry(no config)
winsw (https://kenai.com/projects/winsw) .net required, stops after process dies
commons-daemon, procrun (http://commons.apache.org/proper/commons-daemon/index.html) store launch parameters in registry(no config), can't understand this product, i think it's complex.
jsmooth (http://jsmooth.sourceforge.net) complex and old(last update 2007)
javaservice (http://forge.ow2.org/projects/javaservice/) old (last update 2006)
runasservice (http://runasservice.sourceforge.net/) requires .net
windows rktools - sc, instsrv, srvany (http://support.microsoft.com/?scid=kb%3Ben-us%3B137890&x=16&y=7) - store launch parameters in registry(no config)
jwrapper (http://www.jwrapper.com/) seems not what i need. It packs java program in exe file with JRE. It's not about windows services.
firedaemon (http://www.firedaemon.com/) not free. And maybe it's not what i need.
launch4j (http://launch4j.sourceforge.net/) cool ability "search or download java". Maybe i add something like this to simplify installation, but it is still not about subj.
Java service wrapper (http://wrapper.tanukisoftware.com/) not free for win64.
Tell me please which wrappers suits my needs? Or maybe i think wrong about wrappers above and some of them suits my needs to?
I have had similar issues over the years. Its not that they all are inferior, its that they are all pretty hard to integrate nicely with your own project.
You may want to check out stork: https://github.com/fizzed/stork
It'll help create launchers for your Java console or daemon apps, and they will work across all major platforms. There is also a maven plugin in case you wanted to tie it into your existing build process.
I'm not sure if JWrapper will fulfil all the requirements like 1 and 2 in the way that you want it since rather than you dictating how it does the launch and where it puts things etc JWrapper instead handles that stuff in its own way but it does produce executables for win/mac/linux and more importantly it does support windows service installation as well as macos and linux daemon installation:
http://www.jwrapper.com/guide-installing-a-service.html
The service support though is for paid licenses, the free version doesn't currently support it.
Disclosure: I work for JWrapper
I am trying to understand what exactly is going on when you install an application (APK) on an Android device. I guess that files are are extracted from the package and copied somewhere on the device.
Are there other steps going on? For example, is the package name of the application written somewhere in the OS like in somekind of registry?
Is the application version number written as well somewhere or the OS reads the xml manifest of the application to know its installed version?
This is related to another question where I suspect that some data was not erased correctly during the uninstallation of a debug app and I am trying to find what that might be.
There will be files/dirs created in various locations, not necessary in all possible locations for every app though, it depends on how the app is configured.
This list is not necessarily complete.
Files/dirs:
/data/data
/data/app
/data/app-asec
/data/app-lib
/data/dalvik-cache
/data/local/tmp
/mnt/asec
/mnt/obb
/mnt/sdcard/Android/obb
/mnt/sdcard/Android/data
Your app will also get an entry in these files:
/data/system/packages.list
/data/system/packages.xml
/data/system/appops.xml
Since Windows 7 the directory windows/system32/drivers/etc is specially hidden. Windows 7 itself doesn't show it, but it is there if I open it manually.
Today I was playing around with a Java JFace Eclipse example (http://www.ibm.com/developerworks/library/os-ecgui1/) and was wondering that java also doesn't show the etc directory.
So how can I get all directories/Files, when using file.listFiles() ?
Any ideas?
The File.listFiles() method should include normal "hidden" files in the result. If it does not, it is because of something going on at the operating system level to hide the files from the application (and not just the user).
I could not find anything in either java.io.File or the Java 7 java.nio.* extensions that mention accessing "specially hidden" files.
It could be a privilege related thing ... and if that's the case the solution is to execute the Java application with elevated privileges.
But the simple solution is for your application to keep its nose out of the Windows drivers directory tree.
As I wrote, I played around with an JFace Example, that builds up a Java based Windows Explorer.
I agree with you, that a Java application should normally not do something in the Windows driver directory tree.
The "specially hidden" files there, are visible with other programs like Total Commander without running this programs with other then normal rights.
I assume, that Windows has some API functions to get that information.
I'm just interested in a Java based solution that can show me everything, that's on my disk...
I have written a very simple Java application. Can anyone tell me how to create a launcher like icon to run that application both in Ubuntu and Windows ??
Thanks in advance..!!
An executable JAR should work fine for a launcher on both Windows and Linux. However, that won't get you a custom icon.
On Windows, you can use JSmooth, which will create a .exe wrapper around your JAR file. The JSmooth program will let you create an icon for the EXE as well (it also has options such as getting the user to download the necessary version of the JVM, or only permitting one instance of the program to run).
If your java application is to be distributed from a web server, you should have a look at Java Web Start which can do what you ask for based on a JNLP-file. Notably see
http://download.oracle.com/docs/cd/E17476_01/javase/1.5.0/docs/guide/javaws/developersguide/faq.html#104
Ubuntu and Windows will both have different ways to launch the application. I see two routes to follow here. One is to use Java Web Start and use a web interface to start your application. The other is to search for some sort of 3rd party installer that will create setup/installation programs for all the platforms you want to use.
I actually used a third party install program before, InstallAnywhere, but it was almost ten years ago. It offered the functionality you are looking for, though.
There are different ways to do this, sometimes the simplest is the best approach. One solution as suggested is a simple starting script. Roll your application into a jar, then include a script that does nothing more than "java -jar myscript.jar". I do this all the time for internal customers that may be running various types of *nix and whatever version of windows (a few macs as well). How sophisticated you need it to be depends on the audience served.
Create a bat/shell script which starts your application.
And than create a shortcut/launcher for it.
Shortcut file in windows has extension lnk.
Update
See example - SQuirreL launch file.
I am displaying a list of files; i.e. xls, doc, pdf, odt etc., in my Java application (Eclipse RCP). When the user clicks on the file, I want to launch the appropriate (according to what the OS thinks) native application, just like it happens in Windows Explorer or the Finder.
And while I am here: It would be nice to also display the same icons that Finder or Explorer use for the different file types.
Is there a library or Eclipse plugin for this?
What you want is java.awt.Desktop:
Desktop.getDesktop().open( file );
I have found an API in Eclipse's SWT now that seems to do the trick:
org.eclipse.swt.program.Program "provides access to facilities for discovering operating system specific aspects of external program launching."
It has methods to find the program for a given file extension, get the program's icon, and even launch the program.
Sounds like you're after the Java Activation Framework ("JAF"). This API lets you determine what files are and what actions you can do on them. Or alternatively the Java Desktop Integration Component ("JDIC"). JDIC allows you to create and no doubt query file associations.
Both projects seem to be in a semi-abandoned state howeer (sigh). But that's par for the course for Sun these days. Only other thing I know of is some Windows specific third party library that's based on JNI called Winpack. It does a bunch of other things too.
You can get the associated icon using the FileSystemView class (Java 1.4+).