Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  web start persistance  (Read 1139 times)
0 Members and 1 Guest are viewing this topic.
Offline mike_bike_kite

Senior Devvie


Medals: 1
Projects: 2



« Posted 2013-03-30 22:28:04 »

I'm trying to just save a string in a Java web start program. I tried to understand how it was done but failed. Can anyone point me at a really simple example or perhaps explain using little words? It's a program that is usually called via the web page but it also installs itself locally if the user wants. I'd rather not ask the user for any extra permissions like writing to a file.

I can also never seem to get my icon to load on the users web site - are there simple instructions for this to.

Mike

Arcade swarm
Board Chess - Checkers - Othello
Offline tyeeeee1
« Reply #1 - Posted 2013-03-31 01:22:25 »

Are you talking about an applet?
Offline philfrei
« Reply #2 - Posted 2013-03-31 06:31:38 »

Quote
Are you talking about an applet?
Probably not, since he mentions local compilation. And I know that an Applet will not interact with the local file system unless one gets into signing, or explicitly asks permission.

@mike_bike_kite: The Java Tutorials are generally pretty helpful. Here is the link to the "WebStart" tutorial, in case you haven't seen it yet.

http://docs.oracle.com/javase/tutorial/deployment/webstart/index.html

"It's after the end of the world! Don't you know that yet?"
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline mike_bike_kite

Senior Devvie


Medals: 1
Projects: 2



« Reply #3 - Posted 2013-03-31 12:32:11 »

It's an application. I went through the links you gave me and it mentioned nothing until the questions at the end:
Quote
4) Which interface provides the ability to control how the Java Web Start application's resources are cached?

    c) PersistenceService
The answers page didn't want to provide much more info but I found this page which describes a PersistenceService but unfortunately it doesn't describe it in such a way that I can use it. You'd think it wouldn't be hard finding examples on the web but there's not even a simple example to save a string.

I'm currently saving stuff on the server for users but doing this is a PITA and the user has to explicitly hit a save/load button as well  Cry


Arcade swarm
Board Chess - Checkers - Othello
Offline mike_bike_kite

Senior Devvie


Medals: 1
Projects: 2



« Reply #4 - Posted 2013-04-01 09:25:14 »

Has anyone actually tried this? In the PersistenceService example even the import file doesn't exist. I'm just wondering if I'm barking up the wrong tree.

Mike

Arcade swarm
Board Chess - Checkers - Othello
Offline philfrei
« Reply #5 - Posted 2013-04-01 18:50:57 »

I haven't tried this myself. I've only run Applets and gone through the hoop of asking permission for saves & loads. However, I suspect you don't want to be dealing with the PersistenceService. You just want to save/load on the client, without having to deal with permissions, yes?

Did you see this page? It compares Applets and WebStarts.
http://docs.oracle.com/javase/tutorial/deployment/_riaDecisionGuide.html
If I read it correctly, a WebStart should allow you access to the client file system, but will have limited internet access.

If you want to have both web access and client access, I don't know that the client access part is possible without using signing or at least without asking permissions, or via bumping up a level in technology to run a multi-client server (which I also have not done yet).

Did you see the example program called "Notepad" in the WebStart demos? I ran it and it has a File/Save and File/Load in the menu bar, but these haven't been implemented. In my mind, their existence in the menu bar suggests these capabilities are possible but were just not included. Is the source code posted? (There is a code examples area in the tutorial.) Maybe there are comments in the code which say something about how these would be implemented. Or, try plugging in the standard Swing file service to their code and see if it runs.

Or maybe you will get a reply from someone who has actually done this and knows the answer!

"It's after the end of the world! Don't you know that yet?"
Offline mike_bike_kite

Senior Devvie


Medals: 1
Projects: 2



« Reply #6 - Posted 2013-04-02 15:00:25 »

Thanks for your input. I can access the web directory I'm calling the application from so it was easy enough for me to write a server shell script to save and load data but this obviously doesn't work if the user isn't connected to the web. If I write data on the users system then I need a permission to do this - I'm always very wary of downloading things from the web that then start writing files (obviously I can see why they need to but...). I'm only trying to save the settings for a chess game and the users current position so it isn't much data to store - one small string is more than enough. The persistence service looks like it will do exactly what I want but it just won't even compile let alone run.

It's frustrating because the web start idea seems to be exactly what I need to allow users to run my applications on their local machine. The problem is it seems to be poorly documented and the web start process seems to generate more popups than just about any other application delivery process I've tried. I've even been looking at to switching to Android simply because of the simple installation process.

Mike

Arcade swarm
Board Chess - Checkers - Othello
Offline philfrei
« Reply #7 - Posted 2013-04-02 20:10:10 »

Drag.

I still don't understand the game you are making. Two web clients communicating via WebStart programs and a server? In real time?

I found an example program using persistent store, a single line of text that lets you set the "title" of a little calculator app which reappears with each use of the app.

You can get a copy here:
http://horstmann.com/corejava.html
I have the 8th edition. The example program is 10.2 "WebStartCalculator". Code downloads are near the bottom of the web page, under "Further Information".

A cookie might be able to hold the amount of info you require, as well.

"It's after the end of the world! Don't you know that yet?"
Offline mike_bike_kite

Senior Devvie


Medals: 1
Projects: 2



« Reply #8 - Posted 2013-04-02 20:41:09 »

I still don't understand the game you are making.
It's just a chess program. Users run the program on their PC but they'd always want to store their skill level and how they want the board and pieces to look. I think there is a link to the chess in my sig.

I found an example program using persistent store, a single line of text that lets you set the "title" of a little calculator app which reappears with each use of the app.

You can get a copy here:
That would be quite an expensive purchase for one line of code! I don't suppose you can just tell me the command or what I need to call? Anyway thanks for your help.

A cookie might be able to hold the amount of info you require, as well.
I'm open to any suggestions - can I save and load cookies from a web start application?

Arcade swarm
Board Chess - Checkers - Othello
Offline philfrei
« Reply #9 - Posted 2013-04-03 01:48:02 »

The example code is free, isn't it? Particularly on vol 8 since 9 is current.

I'm about to learn about cookies in an online course I'm taking at JavaRanch. Probably be about a week before I can say anything more on that.

"It's after the end of the world! Don't you know that yet?"
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline mike_bike_kite

Senior Devvie


Medals: 1
Projects: 2



« Reply #10 - Posted 2013-04-24 07:07:22 »

Perhaps there is another solution that someone can point me to (web start application just needs to save a single string regards the users settings but not go requesting permissions to do this)?

I read about persistence but I just can't get it to work. There's also precious little on the web about it which makes me think it's an abandoned feature. Pretty much the same for these cookies. I guess I'll just have to forget the users settings each time but it just seems such a shame as my chess program is quite fully featured.

Mike

Arcade swarm
Board Chess - Checkers - Othello
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (26 views)
2014-11-22 12:13:56

xFryIx (69 views)
2014-11-13 12:34:49

digdugdiggy (48 views)
2014-11-12 21:11:50

digdugdiggy (42 views)
2014-11-12 21:10:15

digdugdiggy (36 views)
2014-11-12 21:09:33

kovacsa (60 views)
2014-11-07 19:57:14

TehJavaDev (64 views)
2014-11-03 22:04:50

BurntPizza (62 views)
2014-11-03 18:54:52

moogie (77 views)
2014-11-03 06:22:04

CopyableCougar4 (77 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!