Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
So I have this text file called 'arrlog.txt' that I want time data written to.
I have defined a button called 'btnArr' and a time text field called 'etArr'. When I open this in the emulator, it literally doesn't do anything. It doesnt read to the file. It doesn't shout and scream with an error (IOException), it just closes and does nothing. Rather strange as I cant find a place in my program for this application to simply just close.
I think it may not be initialising something correctly, the file path is correct and so the FileWriter should either run the catch or it should find it and write the numbers into the file.
First, when asking for help with programming problems, please post the source code as text, not as a screenshot.
the file path is correct
No, it is not. Android does not have a C: drive. Presumably, your development machine is Windows, and that machine has a C: drive. But neither your Android device nor your Android emulator is Windows.
You are welcome to write your data to internal storage or external storage, though.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm creating a game in java and I want to store the scores on a csv file on the internet so different people who download the game and can compete for a high score.
How can I:
create a csv file and give it a url
make the csv file editable only through my program
access data from that csv file given its url
edit that csv file given its url
thanks!
Edit: Sorry I don't have code to post as I don't even know where to start. I tried looking it up but only find things relating to files that have already been downloaded
run a server (probably in java) on a computer that is always on, and have the client (the game) connect to it via a socket. Use something like freedns or noip to get the URL.
have the client report its score to the server, and the server will write it to a csv file.
have the client request scores from the server
this is solved by 2
sign up for freeDNS here
use this tutorial for sockets: youtube.com
if you don't have a computer that is always on, try using amazon AWS free
This is probably a bit more complicated than what you wanted, but it's the only way I've heard of.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am creating a Choose your own adventure in Eclipse Mars 2 and I would like to implement a save feature so i can save the game with a button and re load where i was with another. I am fairly new to programming and don't know how to go about this.
A common way of doing this is to save the game state to a file at location X on the user's filesystem, and to load the game by reading the file (if any) at location X. There are several main challenges here:
The user might not appreciate your game writing files. However, file-writing happens all the time by various applications to store settings and other saved information.
If the user deletes the file, their save is also lost.
You'll have to figure out how to serialize and deserialize your game state to a file.
Users now have a way of cheating by modifying the file if they can reverse-engineer your (de)serialization process.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I am starting to build my first website with Angular&Bootstrap. I am using the Spring Tool Suite. So far my website looks pretty boring but learning CSS takes me a while.
On my website I have an input (style=file) and a button to submit. So far I managed to press a button to upload a file. I can see is as a String in the console when I log it, its working.
Now to the point where I need help:
I got a java-program that I have to use which gets the path to an XML-File and parses it. It checks if it has the right special format and reads it in. This is only a part of the whole program.
How can I use this in my Code to upload an XML-File and then check it and read it with this program? How do I use the Java-Code? So far I am only using HTML, CSS and Javascript.
Thank you for your help!
There are two options precisely available for you:
1) convert the logic which is in Java to Java script
Or
2) make it a web application and run it on tomcat(or a similar web server)
There are others too but there are a bit heavy to understand and implement.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I hope this doesn't sound silly. I've looked it up but can't find anything.
Let's use this example to keep from being too general. In my VB.NET application, I want to do this:
Dim ASDF As String = "This is a string."
Dim UIOP As Integer = 54
From here, I want to send the values of these variables to a Java application that is already running locally on my computer - I don't want the program to start the application because it is already running. What would be the simplest way to achieve this? Thanks for your help!
I had a similar problem once which involved passing information from a Python program to a C++ application which was already running, same as in your case.
The most reliable solution I could find was to simply have the first program create a text file with the relevant info, and then have the second program read and destroy the file. This solution works really well if you only have to pass information between programs a few times, not continuously.
A more structured way of doing the same thing, instead of using a text file, would be to use an XML file. Both Java and VB.NET support XML data parsing, VB.NET with XmlTextReader and Java with Document Object Model. Using xml will allow you to have a hierarchical structure for your data.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Well this is just something i am wondering if it is possible.
I have a router and n number of people are connected to it. Now i want to track the downloads , like which person [computer] downloaded what and how much [the size] and finally store the information somewhere in a file / database.
Is this possible? Please don't recommend software, i want to write a code that will run continuously and keep checking for downloads. Downloads should include even the surfing, like when you open facebook some data is downloaded, even that should be added.
If not possible for router is it possible for individual computer?
It would be really useful if it works for a router situation.
Thanks for your help in advance.