Monday, July 1, 2013

Convert from jar to dll

Nowadays, development is very eased from community.
We can easily re-use our code between different platforms in so many ways, gaining time, money and above all... today have multiple skills is not so as useful as before.

By the way, I recently had necessity to bring some java code to .NET runtimes.
No difficulties with IKVM.NET !

If you follow these steps you can convert from JAR to DLL or even from Runnable JAR to EXE!

Tuesday, April 23, 2013

15 reasons why Windows Phone 8 sucks for me ( as consumer )


  1. Facebook app really fucking sucks!  Notification messages doesn’t work!
  2. Integrated Facebook chat is the same...
  3. Twitter, is the same… nicer than Facebook but  same notifications problem.
  4. No dropbox app (but Skydrive is awesome!)
  5. No Instagram app, is there any free alternative?
  6. Native Youtube is missing ☹ 
  7. There’s no alternative browser or search engine to bing
  8. Whatsapp app is maybe the nicest app I downloaded
  9. Sometimes network  goes offline and there’s no way to get it back
  10. Saving photos directly to SD card is very slow, it may takes about 10 seconds per photo
  11. Saving a recorded video to SD card is completely buggy with video lags  and audio strutterings. 
  12. There’s a folder called “Others” that is always full of something that fill internal memory. I can’t delete its content and I must delete some applications because memory is full and phone doesn’t work properly.
  13. Bluetooth doesn’t match with my BT-Voice speaker.
  14. No notification center
  15. Only four vibrations while ringing!


Am I too critic?
Don't you agree with me?

Damn the day I sold my Android :(

Friday, November 9, 2012

That damn NFC alert after tapping a tag on WP8

In these days I had the opportunity to develop a Windows Phone 8 application for my company.
The main reason we choose WP8 was the new Proximity API for reading NFC Tags.

I don't wanna write about how to read or write a NFC Tag but I just want to notify you an issue I encountered while developing.

When you tap a Tag over a device, a system dialog appears asking you if you want to view the content of the tag. A dialog is showed even if there aren't app that can manage a specified tag content.
So read a Tag brings an annoying system dialog.

I had to realize an app that reads tags during an event and does a check-in . So in a single page I want to read several nfc tags without any kind of interruptions.
Can I read a tag without seeing this damn alert that is literally ruining my UX? The answer is yes I can.

Wednesday, August 8, 2012

String-based Socket communication classes

I recently removed an old post called "A little framework for TCP client-server communication".

That's why I think it was not so clear and useful.
Today I propose the "engine" I used.

I used those libs for some projects like:
  • A push server for Android clients
  • A server that controls some computer's feature like volume, services, tasks, also file exchange
  • A computer's mouse controller
  • Data exchange between two different processes

I think it's very useful, scalar and powerful for simple projects.

It's basically composed by two class and two interfaces.

class Server: wraps a ServerSocket object and manages incoming client connections, and messages through an interface called OnServerEventsListener.
interface OnServerEventsListener: defines some standard events like, adding a client, receiving messages, receiving errors of Server or from Clients.
class Client: wraps a Socket object and manages a simple communication through an interface called OnClientEventsListener.
interface OnClientEventsListener: defines events like connecting, disconnecting, on receiving message, on exception generated.

Sunday, August 5, 2012

SQLite wrapper based on java.lang.reflect

In Android development, data persistence is often realized with SQLite. Sometimes the act of preparing all the classes, the adapter, every kind of query (CRUD) and rewrap into model,is a bit frustrating. It's like something already done, to do again every time.

I never see this kind of class on the web, so I decided to make my own one.
What I'm talking about?

A class that simplifies the common use of SQLite with a friendly usage (inspired by .NET's LINQ one).
SQL Scripts are defined by the model, so you need to supply the object instance or just its class.

For the moment I provided:
  • select (distinct, count,where, limit, order by)
  • delete (where)
  • insert
  • transactions

Sunday, July 22, 2012

Some use of java.lang.reflect

You should remember it... a private member of a private class or a private method of a library... it's surely inaccessible at compile-time... but it's not completely inaccessible at run-time :)...


This is not the only purpose of java.lang.reflect but it's good to know how to use the main classes of this namespace.

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