I'm not sure I understand how this android sample works (NsdChat found in developer.android Tutorials).
My first idea was to run 2 istances of the App (with 2 instances of Eclipse on the same machine) and try make them communicate but, it doesn't seem to work: I can't figure out if registration and discovery buttons works and while trying to send a message from 1 to another the destination App show nothing and the Eclipse console of BOTH istances show "Client sent message:test", why?
Maybe I haven't completely understood how the example works. Can someone explain to me how to execute and understand this sample?
your first idea correct. it's run two instance of the app on two phones.
one register the service.
the other one discover and connect. then you can talk.
the samples(NsdHelper.java) have bugs, you need fix it.
Or you just change SERVICE_TYPE = "_http._tcp." to "_ipp._tcp.", NsdChat can be an printer, you even can print on it from Mac.
Related
Dears, can you help me with my problem as it's my first time using this software, and I wanted to download my application on my phone, but it kept showing some errors. I have read some of the familiar cases but couldn't figure it out. so can you help me, please !
My code, and I've highlighted the error that keeps showing up
This is what appears on my phone when i run the program
This looks OK, debugging always slows down the app, and you will have to wait for a bit. You can go faster using some of the available emulator to test it on your computer. Try genymotion, also you can even try bluestacks.
After a lot of work i manage to finish a java web aplication with netbeans using primefaces/glassfish server (it is a e-shop that we developed for a school project). I use xampp (mySql) in order to fiddle around with a database that i use in the web app.
My problem is that i have no idea on how to upload this to a server. What am i supposed to install on it ?, i dont even know what os to use :/ . Im really bad at the "internet part" of this project and since this was my last school year i can not reach for my professor to ask him for help.
I know my question is vague but please help me to finish this project because it would help me a lot to find a job in the future.
I should also mention that i use a mysql-connector-java-5.1.38-bin.jar .If im not wrong this allows me to send data throw a TCP connection right? My main problem is that im missing the Full picture ,I know how to write basic code in java , i know how to build the xhtml pages and how to bind them to the java code behind but other than that i dont get how the rest of this works.
Any help is greatly appreciated.
Edit: as i said im bad at this. if you just post a generic link on "how to set up a Javaweb" i will not be able to follow . Im asking here ,on this forum because i want human answer. I need someone to post a 4-5 line explanation and like 8 bulletins on what to do like
*install linux
*Build and export your project.
*install glassfish standalone.
etc
The thinks google returns to me are like 400 pages of glassfish documentation and really hard to follow guides on how to do what i want. Of course i could waste the next month or so just reading and trying to figure out how everything comes together (witch i inevitably have to do)but i feel like im only 15 clicks away. I just want a practical answer.
You need an application server to "upload" the code. Use tomcat, its simple and has plenty of documentation available.
If you are using XAMPP, you may be familiar with Apache Server, which runs , among other things PHP. For Java, you need application server to run the server side code.
It doesnt matter which OS you want to use, Java runs on all. You just need to download and install tomcat for the OS you want to run it on.
Please refer to http://tomcat.apache.org/
I must point out that there are many more Application servers which are available. Tomcat is one of the most popular for learning purpose.
I have recently started learning android development, and I just built an app that changes color and text based on pushing buttons and gestures. It ran fine on my phone (Yay!), but then on my second run, an error occurred. When hitting the "run" button, an edit configurations window opened up:
I also noticed, that on the side where my project tree should be is this instead:
I don't think there is an issue in the code because it was running fine before, but I would be happy to post the code if needed.
Also
I dont know if this was the reason, but i'll include this anyway, I tried changing the name of my project, but it wouldn't work, but I changed it back. I included this in my question because that's literally the only thing I did before this error occured.
Thank you so much for helping out a fellow programmer, I really appreciate it. I have been looking at many other forums (for some hours) about this topic, but still couldn't trouble shoot this problem. It seems kind of odd that it was working first, and then it just randomly stopped working. I cant wait for your response!
Here is the dropdown for Module:
As you can see, that is the only option.
Are you sure you are opening the project as android gradle project ?
Try to import the program not open it
I am creating a complex game, because of this I use System.out.println(); a lot to test to see if something works or to see if something went wrong. To see these messages I have been going to the CMD or terminal and running it from there but I was wondering if there was an easier way. I thought of a couple ways and came up with running with a batch, but I have no idea how to make one, and another way was to put a button in game that opens the console that the game is running in. I don't even know if the second one is possible but I was wondering if there was a way! Thanks in advanced!
This is what logging frameworks are for.
Use sfl4j - http://www.slf4j.org/ - in your code to generate the log events, and choose a suitable backend for your purpose. I would suggest using slf4j-simple which is easy to get started with and which easily can be sent to a file you can view in your favorite file viewer.
http://www.slf4j.org/api/org/slf4j/impl/SimpleLogger.html
I read the nebeans tutorial for RESTfull service (http://netbeans.org/kb/docs/websvc/rest.html) and tried to implement it. But when i'm run the test I'm not getting the screen what they say. I found that some say it is a bug on netbeans whilst some say it is bug on browser.I read some related question on this site but could not get much help
Suppose to appear as previous one
but appear as following one....
Note that navigation is not appears.
I'm unable to get the test it further.
I'm using netbeans 7.1 bundle
Can any one help me out. Thank you.
p.s : This page opens as reading a file( file:///home/xxx/xxx )
In that link you can notice the caution
Caution: For later versions of Firefox, you need to generate the test client in another Java web application than the service project.
I got the same error in firefox and chrome, then I tried test-resbeans.html in IE and its working fine as mentioned.
That tutorial dose't work on that way. When we test the restfull test we need to brows and give that restfull service. Then it will work on any browser.(I guess to test it need a service).