still learning

Put your problem here if it does not fit any of the other categories.

still learning

Postby Raskyl » Tue Dec 21, 2010 6:31 am

Hi guys :D i'm doing some Socket programming and yeah. i just wanna know what SetSocketOption does. its not really a problem so i dont know where this question should be put at, yeah. lol
i'm trying to receive some text from the server when i press next or previous. like... a book if you will. but when i press back the words sometimes does not appear. even if it says its page 3, it shows page 4 text. and sometimes when i press back a few times to page 1 , i will still see page 4's text even when its a page 1 image.
lolok its a problem now XD maybe someone can move this post to the correct forum?
Raskyl
Junior Developer
Junior Developer
 
Posts: 14
Joined: Wed Dec 15, 2010 6:48 am

Top

Re: still learning

Postby blundell » Tue Dec 21, 2010 1:11 pm

Add some code to define your problem.
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Re: still learning

Postby Raskyl » Wed Dec 22, 2010 1:30 am

sorry i typed in VB codes by mistake so i deleted it D: sorry sorry D:
Last edited by Raskyl on Wed Dec 22, 2010 6:53 am, edited 1 time in total.
Raskyl
Junior Developer
Junior Developer
 
Posts: 14
Joined: Wed Dec 15, 2010 6:48 am

Re: still learning

Postby blundell » Wed Dec 22, 2010 1:43 am

Add some printout to your code, like so

System.out.println("This is line 3 my variable is:" +someVarName);

or

Log.i("MyTag", "This is line 3 my variable is:" +someVarName);

Then check your Logcat for what it is saying, this is how you define your problem and work out on what line of code it is going wrong. It is the essence of programming / debugging.
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Re: still learning

Postby blundell » Wed Dec 22, 2010 1:44 am

And WTF that code you sent isn't that VB not Java/Android?
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Re: still learning

Postby Raskyl » Wed Dec 22, 2010 6:51 am

eh wait wait sorry lol! posted in wrong forum!! LOL wait sorry sorry!
i found where the weird error occurs.

public TextView mConversationView;
if(value.contains("SendStory~")){

String[] values = value.split("~");
mConversationView.setText(values[1]);

}
else if(value.contains("NewPage")){

ShowNewPage(value);
}

else if(value.contains("SendPage")){

Toast.makeText(getBaseContext(), value, 2000);
getpage(value);


}

else if(value.contains("slideEnd")){


endReceivingpage(value);


}

yeah. when i change the orders i kept getting random errors. if i put the "SendStory~" first, i would recieve the text and it can go next page and previous pages alright but i keep getting extra text at the end like. "SendPage,9391,1,Page 1.jpg" something like that
9391 is how big the file is, in bytes
1 is the page its on.
Page 1.jpg is the image of the page.
yeah so the text and pic will be alright but i would get text like "The big bad wolf came bursting in!SendPage,9391,1,Page 1.jpg"
yeah lol putting the "SendStory" anywhere else would be worse, the pictures will move(next and previous pages) but the text randomly does not move (most often when i press previous page).
Raskyl
Junior Developer
Junior Developer
 
Posts: 14
Joined: Wed Dec 15, 2010 6:48 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 13 guests