Click here to Skip to main content
15,921,210 members
Home / Discussions / Java
   

Java

 
QuestionEncrypt using java and Decrypt with C Pin
Murugan k16-Jun-10 19:43
Murugan k16-Jun-10 19:43 
AnswerRe: Encrypt using java and Decrypt with C Pin
Richard MacCutchan16-Jun-10 21:30
mveRichard MacCutchan16-Jun-10 21:30 
QuestionSubstring issue Pin
CodeScribbler15-Jun-10 3:11
CodeScribbler15-Jun-10 3:11 
AnswerRe: Substring issue Pin
Richard MacCutchan15-Jun-10 21:56
mveRichard MacCutchan15-Jun-10 21:56 
AnswerRe: Substring issue Pin
David Skelly15-Jun-10 22:35
David Skelly15-Jun-10 22:35 
GeneralRe: Substring issue Pin
CodeScribbler17-Jun-10 2:43
CodeScribbler17-Jun-10 2:43 
QuestionEmulating a serial communication through RFCOMM Pin
ant-damage14-Jun-10 10:36
ant-damage14-Jun-10 10:36 
QuestionNokia 2323 DateTime Issue??? Pin
Member 211994514-Jun-10 2:56
Member 211994514-Jun-10 2:56 
Hi guys,

I have had some java software written for me that hits a web address and passes through a date/time value in the format of:
YYYYMMDDHHmmSS

Most of the time the date/time comes through correctly... but for some reason it "randomly" sends a through date/time values that are 50 days in the future...

The data gets sent through every 15 seconds and the data will be correct at 10:00:00 but then 15 seconds later I'll get 17:30:22 50 days in advance... and then the date/time value increments by 15 seconds, but still 50 days the future... it will also then "randomly" come good again... now this isn't an odd one here and there, it's right for a while, then will run the rest of the day sending the wrong time...

Does this make sense...???

The problem is I can't reproduce it at will... I know, I know, I'm a programmer and that is the first thing I ask my users to do.. Give me repro steps... but I can't figure out how to reproduce it...

I've tried setting the phone date/time back to a time just before when it has happened in the past, but then the software just works.. it sends the correct time values right through the previous problem window...

Now the only other thing I could think of was that the phone does something "odd" with time calculations or stores the date/time in a funny way internally that wouldn't be necessarily visible to the developer...

I'm clutching at anything I can at the moment because my boss is starting to get shirty about this bug...

Here is the code that I'm told is being used to formulate the date/time value ready for sending via the URL:

private String getTimestamp() {
	String time = "00000000000000";
	try {
		// it gets the calendar instance    
		Calendar ca = Calendar.getInstance();
		// here I set the calendar date by getting the current time from the phone system
		ca.setTime(new Date(System.currentTimeMillis()));
		// here I get the year from calendar
		int year = ca.get(Calendar.YEAR);
		// here I convert it to string
		String syear = Integer.toString(year);
		// here I get the month (I need to add 1 'cause the months from calendar starts at 0)
		int month = ca.get(Calendar.MONTH) + 1;
		// here I convert it to string, if the month is before October (10) I put a 0 in front of the number (e.g. if month is January (1) it needs to be "01"
		String smonth = month < 10 ? "0" + Integer.toString(month) : Integer.toString(month);
		// here I get the day of the month
		int day = ca.get(Calendar.DAY_OF_MONTH);
		// here I convert it to string
		String sday = day < 10 ? "0" + Integer.toString(day) : Integer.toString(day);
		// here I get the hour
		int hour = ca.get(Calendar.HOUR_OF_DAY);
		// here I convert it to string
		String shour = hour < 10 ? "0" + Integer.toString(hour) : Integer.toString(hour);
		// here I get the minutes
		int min = ca.get(Calendar.MINUTE);
		// here I convert it to string
		String smin = min < 10 ? "0" + Integer.toString(min) : Integer.toString(min);
		// here I get the seconds
		int second = ca.get(Calendar.SECOND);
		// here I convert it to string
		String ssecond = second < 10 ? "0" + Integer.toString(second) : Integer.toString(second);
		// here I put the date to the correct format (e.g. 201006091300)
		time = syear + smonth + sday + shour + smin + ssecond;
	} catch (Exception e) {
		// nothing
	}
	return time;
}


As stated in the Subject here... this is happening on two different Nokia 2323 phones... unfortunately I don't have another nokia phone to test this on to see if its a specific 2323 problem or a Nokia problem...

HELP ME PLEASE..!!!!

If anyone has a suggestin, no matter how crazy, I'm willing to try it out...

Has anyone ever come across this issue before...

If you need more clarification or have questions... shoot them through...

Thanks

** I'm not crazy.. Just ask my toaster **

AnswerRe: Nokia 2323 DateTime Issue??? Pin
Richard MacCutchan14-Jun-10 4:39
mveRichard MacCutchan14-Jun-10 4:39 
GeneralRe: Nokia 2323 DateTime Issue??? Pin
Member 211994514-Jun-10 14:22
Member 211994514-Jun-10 14:22 
GeneralRe: Nokia 2323 DateTime Issue??? Pin
David Skelly14-Jun-10 22:48
David Skelly14-Jun-10 22:48 
GeneralRe: Nokia 2323 DateTime Issue??? Pin
Member 211994515-Jun-10 1:51
Member 211994515-Jun-10 1:51 
GeneralRe: Nokia 2323 DateTime Issue??? [modified] Pin
Richard MacCutchan15-Jun-10 3:54
mveRichard MacCutchan15-Jun-10 3:54 
GeneralRe: Nokia 2323 DateTime Issue??? Pin
David Skelly15-Jun-10 4:24
David Skelly15-Jun-10 4:24 
GeneralRe: Nokia 2323 DateTime Issue??? Pin
Richard MacCutchan15-Jun-10 5:01
mveRichard MacCutchan15-Jun-10 5:01 
GeneralRe: Nokia 2323 DateTime Issue??? Pin
David Skelly15-Jun-10 6:40
David Skelly15-Jun-10 6:40 
GeneralRe: Nokia 2323 DateTime Issue??? Pin
Richard MacCutchan15-Jun-10 6:59
mveRichard MacCutchan15-Jun-10 6:59 
GeneralRe: Nokia 2323 DateTime Issue??? Pin
Member 211994515-Jun-10 14:17
Member 211994515-Jun-10 14:17 
QuestionHow can I add Resources with jar file? Pin
002comp13-Jun-10 18:20
002comp13-Jun-10 18:20 
AnswerRe: How can I add Resources with jar file? (Solved) Pin
002comp13-Jun-10 18:50
002comp13-Jun-10 18:50 
QuestionSending of byte array messages to an VB Receiving Emulator application Pin
pohcb_sonic10-Jun-10 18:43
pohcb_sonic10-Jun-10 18:43 
AnswerRe: Sending of byte array messages to an VB Receiving Emulator application Pin
Richard MacCutchan10-Jun-10 23:15
mveRichard MacCutchan10-Jun-10 23:15 
GeneralRe: Sending of byte array messages to an VB Receiving Emulator application [modified] Pin
pohcb_sonic14-Jun-10 14:40
pohcb_sonic14-Jun-10 14:40 
GeneralRe: Sending of byte array messages to an VB Receiving Emulator application Pin
Richard MacCutchan15-Jun-10 4:48
mveRichard MacCutchan15-Jun-10 4:48 
QuestionHow to resizethe backGround Image to JPanel? Pin
002comp9-Jun-10 1:48
002comp9-Jun-10 1:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.