Skip to content

Instantly share code, notes, and snippets.

@marharrUK
marharrUK / formattedDate
Created July 20, 2011 11:37
formattedDate
public static String getFormattedDate(String date){
int dtLen = date.length();
String dtPart1 = date.substring(0, dtLen-5);
String dtPart2 = date.substring(dtLen-5);
return dtPart1.concat(dtPart2.replace(":", ""));
}
@marharrUK
marharrUK / Asset.java
Created July 21, 2011 09:30
Serializing an ArrayList using the Simple Framework for XML
package com.softsols.xmltest;
import org.simpleframework.xml.Default;
import org.simpleframework.xml.Root;
@Default
@Root(name="Job")
public class Job extends MessageType {
private String jobCode;
private String assetCode;
@marharrUK
marharrUK / ServiceConnection.java
Created August 12, 2011 08:33
KSOAP ServiceConnection
/* Copyright (c) 2003,2004, Stefan Haustein, Oberhausen, Rhld., Germany
* Copyright (c) 2006, James Seigel, Calgary, AB., Canada
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@marharrUK
marharrUK / ServiceConnectionSE.java
Created August 12, 2011 08:33
ServiceConnectionSE KSOAP
/* Copyright (c) 2003,2004, Stefan Haustein, Oberhausen, Rhld., Germany
* Copyright (c) 2006, James Seigel, Calgary, AB., Canada
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@marharrUK
marharrUK / HttpTransportSE.java
Created August 12, 2011 08:37
HttpTransportSE KSOAP
/**
* Copyright (c) 2003,2004, Stefan Haustein, Oberhausen, Rhld., Germany
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@marharrUK
marharrUK / Transport.java
Created August 12, 2011 08:38
Transport KSOAP
/**
* Copyright (c) 2006, James Seigel, Calgary, AB., Canada
* Copyright (c) 2003,2004, Stefan Haustein, Oberhausen, Rhld., Germany
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@marharrUK
marharrUK / GeneralInteface.java
Created August 12, 2011 15:55
GeneralInterface
package com.softsols.communication;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.List;
@marharrUK
marharrUK / gallery.xml
Created March 30, 2012 10:48
layout for picture gallery with controls at the bottom of the screen, gallery centered between top of controls and top of device