Tuesday, December 28, 2010

cold in Atlanta

It is too cold to run! And I hate it! :(

Thursday, November 18, 2010

Communicating with WebServices

It was a bit challenging for me to communicate with SOAP based Web Services from Android platform.
I tried building stubs and using java libraries to invoke web service using SOAP protocol. Of course it was a failure :) Then I found this kSOAP2, a third party library to send request objects and get the response object from the web service. At first it looked like a great solution but working with complex types was another show stopper. And in addition to that, the web service was receiving the element types as objects instead of primitive types, so I ended up getting an error code all the time.
My 3rd attempt was directly calling the web service through simple HttpUrlConnection sending an xml request. Of course the burden was parsing the xml properly and in a light weight so it won't kill my Android application.
Well it worked perfectly! and even faster!
The next R&D will be on calling existing application with wrappers. So this way it will be more secure.




URL url = new URL("http://..........");

HttpURLConnection http = (HttpURLConnection) url.openConnection();

http.setDoInput(true);
http.setDoOutput(true);
http.setRequestMethod("POST");
http.setRequestProperty("Content-Type", "text/xml");

DataOutputStream stream = new DataOutputStream(http.getOutputStream());
//Build your xml request
//based on the wsdl

StringBuffer xmlInput = new StringBuffer();
xmlInput.append("");
xmlInput.append("");
xmlInput.append("");
xmlInput.append("");
xmlInput.append(""+ acct +"");
xmlInput.append("
");
xmlInput.append("
");
xmlInput.append("");

stream.writeBytes(xmlInput.toString());
stream.flush();
stream.close();

http.connect();

int response = http.getResponseCode();
if(response == 200)
{
BufferedInputStream bis = new BufferedInputStream(http.getInputStream());
//you can use either SAXparser or DocumentBuilderFactory to parse your xml

Tuesday, August 24, 2010

Android in Eclipse

Finally, I found the fix for the annoying error after configuring eclipse for Android!
The annoying error is :

1. Project " xxx " is missing required source folder: 'gen'

2. The project could not be built until build path errors are resolved.

I tried deleting the gen folder and rebuilding the project again. That solved the problem but I didn't want to do the same thing every time whenever I create a new project.

So I kept searching for a better solution and I came across a blog giving the best solution and makes perfect sense.

Here's the solution to get rid of the annoying build error:
Use Project > Properties > Java Compiler > JDK Compliance > Compiler compliance level: 1.6

Thanks to Christian for the answer and thanks to Joshua for providing the post.

www.joshuakerr.com

Thursday, June 10, 2010

3 is good and 6 is even better :)

Back to running! I received my runner's watch today that I ordered from online. Couldn't be much happier.
And no more listening to music when running, just thinking about running :) and focusing on my breathing.
Today I ran 2.2 miles in 19.57 minutes, I was going for 3 miles but the weather was too hot so I had to cut it short.

4 months to half marathon......

Wednesday, March 10, 2010

What is reality?

I stepped into the quantum world, where everything is at possibility.

If our minds shape up our reality then the world is not actually out there, and we choose our world by simply seeing the world the way we see it in our mind.

Seriously, can we control our world by simply changing our perception???

Tuesday, March 9, 2010

Ezel

20. bolumde Ramiz Dayi'nin soyledigi lafi buraya eklemem lazim! Bir gun olur unututum buraya bakip hatirlarim...

“insan bir gun girtlaklayacagi tavugu sevmeye baslarsa ac kalir”


Ramiz Dayi'miza laf yok :)

Wednesday, February 24, 2010

iPhone applications development

Just coming from an iPhone application development session. I've been thinking to develop an app for iPhone for a while and as the master of procrastinator I was always postponing it to some other time. But after today's session I've decided to set up my environment as soon as I can. What made me to come out of my laziness is that I must learn new programming language for development. I don't know why I keep thinking Java is the solution for all, but I was mistaken. To write iPhone app you need to know objective C which is a kind of super set of C/C++.
Maybe after this, I'll have a better grasp of how to manage memory ;) Java made us all lazy by doing it is own GC.