Tuesday, March 27, 2012

Catch LogCat programmatically or export it to file

UPDATE - THIS POST IS VALID ONLY FOR API < 16 (ANDORID 4.1 JELLY BEAN), OTHERWISE YOU NEED ROOT PERMISSION 




Let'see how to catch LogCat from code.
It's very simple, just remember how to call it, and read his input stream.


LogCat process can be launched with parameters such as -help for help,
-s for silent filter,
-d for dump
-c for clear and,
-f for file export.

The (Nyan)LogCat

Monday, March 12, 2012

A month view calendar for WP7


We know that wp7 is a bit young but it has a good potential.
We also know that its youth means, for developers, poor os-controls, poor API etc...

Last week I had to demonstrate that WP7 is comparable to iOS and Android. 
I had to realize a sort of "accounting app" already done in iOS and Android.

I had no significant problems while working except for some limits of SDK.
SDK doesn't provide a datetime picker, a combo box or list picker not even a calendar.

I found on the web a Silverlight for Windows Phone Toolkit that brings some controls I've just mentioned.

No track of a calendar :(

I found only 1 calendar for wp7 on web but it didn't like me.... So..
I decided to make my own :)

Fixed layout for PhoneApplicationPage

As a beginner in WP7 I found some issues for my first applications.
One of those problems I had was the hated "fixed layout" of a page.

It's a topic already discussed (view the post for Android) but in this case, it's a bit different.

Suppose we want a "fixed header and footer" for every page, how do you do it?

Sunday, March 11, 2012

A little framework for TCP client-server communications (part2)

Here we are for the second part of this article.  I remeber to everybody that this little framework is not created for market, distrubution or diffusion. (Not even for best practices)

Let's start with some example code!

On the base of what I wrote in the first part, let' see how to create a simple server with JRR Framework.

ResponseManager server = new ResponseManager(8888); //8888 is the listening port
server.setConsoleLogEnabled(true); //enable printing log on the console
server.start(); //start listening