Attaching Large Libraries of Strings to an app - java

I am very new to Java programming and I have a question about a project I am working on.
I need to, essentially, have a way to reference A string after the user has given me some input. This input will be through buttons i set up and this String will be about a paragraph long. I have been looking around the internet and I think what I need is to "Provide Resources" and "Access Resources" so that my code isn't filled with paragraphs of Strings.
I also have a fair amount of questions about how this works:
Is this more a question of Data and Storage? or both?
Do I have to go through ResourceBundling? What is that and where can i go so I can learn about it enough to be able to apply it?
Will I have to put all this data on the internet and have the app reference it through the web or can it somehow be downloaded with the app so the user can use it without having an internet connection? (It's a lot of data, I mean like a Lot)
I am more than willing to put in the time to learn this but I just need to be pointed in the right direction. A little insight on what to focus on, where to go to find it, or what keywords or concepts I should be looking for would be more help than you know.
Thank you for your time.

Related

Java console explorer RPG game

This is more of a general question not a specific coding one, but in school we got this assignment to make our own dungeon RPG console explorer game you know the one with tons of text where you type where to go, etc. My question here to the more experienced programmers is what would be the best way to fundamentally approach this like read the text from a file and store the play options into an array, etc. I am open to having to learn anything new. Thanks in advance.
Objected Oriented programming is Java's forte. If you are going with Java, try to take advantage of these primitives.
For example, reading everything from a file and having a user select inputs with his keyboard would be something more akin to scripting, which you could perfectly do with something like Python and would therefore be a situation of using a rocket launcher to kill a mouse.
The array thing, not sure what you mean, but generally storing such information statically in an array is generally not a good idea, especially if the information is already stored in files (unless you're going to be using them all of the time).

How to make save game in java applet game?

I have been looking from everywhere how would it be possible to make a save game file in java applet but of course it is not possible to just make an xml file... (or would it? please tell me!)
I don't want to make the "player" to log in to game with username, password and stuff like that, that goes to some server and things like that...
Just what would be the easiest and the most simple way to save a couple of variables so the player don't need to start the game from the beginning every time? (Becouse in an rpg game it would be so lame...)
Generally you can't save files, because of the security restrictions. Unless it's running as a trusted applet, which is problematic. The short answer is no, you can't write files, because Java applets runs in sandbox. From sandbox you don't see the local file system.
Maybe you can store your save game in a cookie? Here you have an official tutorial how to handle cookies from Java.
This link can be also helpful, somebody had a similar question.

Java Remote desktop administration

I m currently working on my project of remote desktop administration. I m using robot class to capture images and send over network. It works well but bit slower.
Because all the time we need to captuure and send image its too costly. Is it possible to detect only a portion of screen which is changed and send only that portion?
Please any one guide me on this. Thank you!!!
The keyword you're looking for (in order to be able to look this up and figure the solution yourself) is dirty rectangles.
You can look into some code here.
I looked into this awhile back, and the image capture is implemented particularly inefficiently. I don't recall the specific detail, but it was pretty bad the way they did it. I felt, at the time, that the only way to do it better would be to implement it in JNI. Which you could use JNA to shortcut.
I don't know if any platform's screen capture routines will allow only changed sections to be sent, but you could implement a decent image diff; although that could get expensive too. You would really need to measure whats going on to see if it works for you.

Java applet to connect different users to a shared screen window

No, Im not asking for a full made program :) Im kind of new to Java as language so Im not familiar with java libraries at all and my experience is mostly about php, but I understand OOP well.
My scenario:
I want to build a Java applet to my website, by which different users can share a same screen window in which they can drag and drop things(images) to specific positions and when one does, it would update the screen to the others. Before connecting, user would choose to build a new screen or join other. If he wants to join other he would just enter some existing (random) screen id to connect to. If he wants to create a new one he would access this screen in which he would see the screen id to share with someone else. I dont care if two persons wants to drag and drop different item to same spot, it would then just use the one that came last.
Now that you understand what I want to build...
What I really just need is the skeleton structure of something like this. What parts I will need to build something like this? Libraries and such, where should I look for tutorials, Best practices, hierarchy, should I use tcp or udp? I just need something where to start from.
An applet is run in the system memory of each individual client. There are strict rules about what applets can and cannot do, and I am not sure whether or not applets would be allowed to make remote connections to other users. I would advice doing some google leg work on java applet security and seeing what you dig up.
Assuming this is possible:
In terms of architecture, I think you would want one person designated as the host create the game and run all the game logic, while the clients just receive information pertinent to graphics being displayed (location, size, texture, what have you) and sends back information about what the client is doing.
I did something like this as a school project in high school, but I was forced to sign the applet to make it do remote http connections. I would assume this is still the same case.
Hope that helps a little bit.

Converting equations to java for android?

I am a cameraman and I want to make an app for my Moto Droid that will
calculate my depth of field given four inputs.
I am literally brand
new to javascript and this programming stuff, so I was wondering if
anyone could help me out.
I have a very basic GUI set up using Droiddraw which allows me to
input my 4 variables, which are:
Focus (#+id/focust)
Focal Length (#+id/flt)
Aperture (#+id/apt)
Circle of Confusion (#+id/coct)
Equations for this calculation are located here
for example...
to get hyperfocal distance I need to get: ((f^2)/(N*c))+f
all of these variables will be drawn from inputs in the GUI, but I don't know how to call them, how to write the actual math, and how to address the results so I can make them appear in the "results area" on the bottom of the screen.
I've never done java before and I only want to make this app because the existing ones don't fit my needs.
Can someone help?
Thanks!
If I'm not mistaken, DroidDraw is a tool for building the XML user interface description used by the Java API. If you want to program for Android in JavaScript, something like PhoneGap might be a better choice. It lets you build real Android application using HTML and JavaScript.
On the other hand, if you want to use the XML and Java APIs, then you should probably run through the Android tutorials. The first one is Hello, World.
Since you're just getting started with programming, I can't stress tutorials enough. It's true that your idea shouldn't be too hard to implement, but you need to understand the basics first.
I don't mean to give the impression that one style (PhoneGap vs. Java and XML) is better. For your purposes, either should be fine. It's more a question of what you prefer. Java/XML is the paradigm supported by Google, and provides access to more functionality. On the other hand, if you already know HTML or JavaScript (or are interested in learning them), PhoneGap will certainly provide everything you need. I think PhoneGap is also intended to make it easier for beginners, though I haven't used it, so I don't know how successful they have been.
The XML file that is generated by DroidDraw can't be used within PhoneGap. If you do choose to use PhoneGap, then you will need to build the interface in HTML. You might be able to use something like DreamWeaver or FrontPage or one of any number of HTML editors to help you with this step.
The XML file is just a description of an interface. When you start your application, the Android platform uses this description to build the user interface that you see. Once that has happened, you can move data from the interface to Java, or from Java to the interface, without any hassle. You certainly won't be limited by the XML interface description - it's pretty flexible.
If you've been going through the Android tutorials, then it might be best to forget that I even mentioned PhoneGap. It's a wildly different alternative that is the right choice for some people and some applications. But the Android tutorials won't help you to understand it. I only brought it up because you mentioned JavaScript in your original post.

Categories

Resources