This week's giveaway is in the Spring forum.
We're giving away four copies of Microservices Testing (Live Project) and have Chris Love & Andres Sacco on-line!
See this thread for details.
Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

simone giusti

Ranch Hand
+ Follow
since Dec 07, 2015
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
7
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by simone giusti

Suppose you have an activity who manage a socket connection (to a telnet server).

MainActivity opens connection to server.
Once this connection is active I can send commands from mainactivity.

Now I need to send a command to that connection from other activity. This connection is not static.

How can I do that ??


Thanks.
5 years ago
Yes .. maybe you are right but since method works from main I thought it worked from other class
How can I assign ?

Rob Spoor wrote:And where do you assign anything to your telnetClient? Because my guess is that you don't, which means the reference remains null.

5 years ago
This is method in mainactivity:



This method reports no errors if called from inside MainActivity.

Thanks.




Rob Spoor wrote:

simone giusti wrote:This is the error:

Attempt to invoke virtual method 'java.lang.String it.rockopera.scsremote.TelnetClient.command(java.lang.String)' on a null object reference


The error is actually pretty clear. Somewhere (not in the code you've shown) you have a reference to a TelnetClient on which you call command. However, that reference is null.

Can you show the piece of code where you call this command method?



5 years ago
MainActivity established a socket connection. I have a method in MainActivity which sends commands to this connection.
How can invoke this method from another class ???

This is the error:

Attempt to invoke virtual method 'java.lang.String it.rockopera.scsremote.TelnetClient.command(java.lang.String)' on a null object reference




This is method whick invoke MainActivity's method


This method could not be static.

Thanks
5 years ago

Tim Moores wrote:Not knowing the IP address would be very unusual. Something like Bonjour might make that possible, but Telnet has really fallen out of favor due to its unsecured nature. Mind telling us a bit about the use case?



I am programming a java app to remotely control a desktop software.
This software acts a server and my app is the client.
At the moment, I manually insert IP and port in app’s settings.
It would be better that app could find automatically these informations looking for software's inside server.
Would you help me suggesting a way to do that ??

Many thanks in advance.
5 years ago
Hello,
is there a way to auto-find a telnet server on a network ??

Suppose there is a server waiting on a port on a unknown IP address ...

I would like my app to explore network obtaing ip and port of this server, without having to set it manually.


thanks !
5 years ago
Suppose you have this class:




I would like to call this method from another class in this way:





here's the error:


Thanks !!
5 years ago
Too easy or too difficult?


simone giusti wrote:Suppose a simple method in MainActivity:



I would like to call it from another class:




This is the result:



Will you help me ???

Thanks.

5 years ago
Suppose a simple method in MainActivity:



I would like to call it from another class:




This is the result:



Will you help me ???

Thanks.
5 years ago
Hello,
I have a simple listview binded to db values.

From MainActivity how can I change value to a textview inside each row of the listview ??
5 years ago
Yes, this is the case.

How can I verify that condition ??

Is it what you mean?
5 years ago
Hello I would like to run a method when a condition occurs.
Since it may happen more than one time I would like to fire method not more than once every 1 o 2 seconds ...

How can I do that ??

Thanks.
5 years ago

Ron McLeod wrote:One problem is the you are calling your update method on a new instance of MainActivity, rather than the launched MainActivity instance:



Thank Ron ... helpful !!
5 years ago
Now this is the error:




here is complete mainactivity code:



and this is DBlayer:

5 years ago
Do have I to declare it before this way ??



Ron McLeod wrote:Then why not have an instance variable for DBLayer, instantiate it and open the db in onCreate(), use it in UpdateLV(), and close it in onDestroy()?

5 years ago