Monday, 30 July 2012

A new project: a Tethering Indicator

I usually take a train in the weekend and travel for 150 km with my Macbook or Tablet connected to my Android phone in tethering mode by bluetooth or wifi.
While I travel by the train, my phone is usually inside my bag and I only have in front of me the Macbook...  I check only sometimes the phone but it is mainly inside my bag.
During my travel the phone connection change a lot and pass in one of this state: no connection, only phone network, 2G or 3G.
What I'm searching to create is an app on the phone that talk with my macbook and regularly send information of the network state of the phone.

How should it work?
These are the step that I have in mind:
  • I launch the apps on the phone and start the bluetooth server
  • I launch the application on the mac
  • I establish from the mac the connection with the phone
  • On the Mac menubar, an Icon display the state of the phone's connection.
This is the basic idea.. but I have some new improvements in mind.

What have I done till now?
The first version of the mac client is in "under construction" state..  The application is capable to connect to the phone but I don't know, for now, how to put and change an icon on the menu bar for the various phone connection state... Need to go deep about it.

Android side is in progres: it is capable to create a bluetooth server and send informations to the connected client back...
Something on the android client will be visible tomorrow soon.

Other platform?
Of Course!
stay tuned.

Thursday, 19 July 2012

Make Osx talks with a Bluetooth GPS

This GPS:
Everything started one week ago when I had a new project in mind.
In this project (I will talk about it in a future post) I have to make my android phone talk with my macbook through bluetooth.
What I need to do:

- expose an RfComm Service on Android device
- search the device from the mac (inquiry)
- establish a connection between the phone and my mac through bluetooth
- pass data between phone and mac

Use a gps bluetooth is enough for a simulation of these operations.

The problems
Yes, this is the first problem.
The second one is .. I've never developed something for OsX but I have did something with IOS (it helps).
Since the arrive of Bluetooth 4.0 LE, Apple make some changes to the bluetooth library.
For what I've seen from the Apple documentation, they did a lot of improvements to make the new library easy to use.
Only new apple product support BT4.0LE... if you have to talk with previous BT device.. you need to use old library.
My Mac and my btgps are old.. so no BT4.
I didn't find any documentation on how to use the old library.. so you have to surf the web searching for the answers.

The code
The code is here(the important stuff, you need to customize it) is on and this is how it works:
  • after application is started it search bt devices and get the names of all the visible bluetooth device (this is called inquiry). In this step I search for the BT Device with the name "HBTGPS" and I save the reference locally. 
  • the second step is searching for the available services on the device.  (it is called SDP: service discovery protocol). Every Bluetooth device can have one ore more services to expose.
  • the third step is: check if RfComm service is present on the device and get the channel on which RfComm is available. A service is bound to a channel.
  • Last step, with the channel and the reference of the bluetooth device I can open the connection and start getting data from the device. Here there are some protocol methoeds call after every change.
This is the output of the program:
2012-07-19 01:19:05.427 FMOSXAPP[406:903] ok, go on
2012-07-19 01:19:05.452 FMOSXAPP[406:903] Let's start inquiry devices around me
2012-07-19 01:19:05.621 FMOSXAPP[406:903] found this device 00-0a-1a-17-88-d6
2012-07-19 01:19:18.335 FMOSXAPP[406:903] updating names for: 1
2012-07-19 01:19:18.435 FMOSXAPP[406:903] That's my boy! HBTGPS
2012-07-19 01:19:18.437 FMOSXAPP[406:903] I gottcha!
2012-07-19 01:19:18.443 FMOSXAPP[406:903] Service: SPP slave
2012-07-19 01:19:18.444 FMOSXAPP[406:903] ChannelID FOUND 1 1
2012-07-19 01:19:18.444 FMOSXAPP[406:903] Found rfcomm channel on device.. 1
2012-07-19 01:19:20.332 FMOSXAPP[406:903] channel complete
2012-07-19 01:19:20.469 FMOSXAPP[406:903] received: ,000,*71
2012-07-19 01:19:20.476

(I've changed a little bit the data from the gps.. just for privacy :P)

Tuesday, 17 July 2012

My Favourites Application's list from UbuntuAppShowdown

At this link, you can find all the application that passed the qualification for Ubuntu App Showdown contest.
I was so curious about this list so I have watched the applications listed.. and this is the list of the applications that IMHO needs attention:
  • Cookety: an application for recipies. I really like the design. Easy, clear, simple. I would like to see it connected with a cloud for hosting,share,save recepies between users.
  • Fogger: pay attention to this app. It hides a website logic inside a unity integrated application.  I like it for many aspects: but the idea to transform unity as a "platform" for website.. is really interesting and new.
  • GWOffice: a desktop client for google drive. It seems a good quality app and I think it is really hard to create something like this... so +1 for this.
  • NitroShare: Cool project. Do you want to share a file with another computer on the LAN? Just drag&drop the file on an Icon on the desktop and it is shared.
  • PostMan: help you to manage photos to send on cloud services like ubuntuone or flickr... So cool UI. Easy to send an image on the cloud, just as sending a letter :)

And this is a list of applications that I found nice(as realization or idea) but for me not able to win:
  • StackLens a unity lens for stack overflow: stack overflow integrated in unity .. good for developers!
  • PicTag: help people to geotag photos. I would like to see it integrated in an application like shotwell instead of a separeted application.
  • XKCD browser: nice to have.. to launch sometimes during an hard working day.
  • Snare: A minimalistic drum machine. I like the style of this application.. clean! Nice UI for this kind of application
  • SmartShine Photo: I don't know how good it is.. but I like the idea. It corrects photos, based on an algorithm.
  • Nulloy Music Player: yes it is just a music player.. but that's why I like it.. Modern players are full of unuseful feature. Just put an mp3 on the player's list and press play. Good.
  • Interest Calculation: It can be useful for people who manage this kind of calculation everyday.
  • Houston ( I hope is not.. "we got a problem" :D ) An UI for manage servers on the cloud. Good Idea, need a lot of work on it.. But it is a nice start.
  • Facebook App: Do we need a facebook app? I don't know.. but it seems (from sshots) a good designed application.
  • Format Junkie: a frontend for easy convert file formats. Good, Ubuntu needs something like this. I'm not enthusiast of the UI but it is just my opinion :)
  • Lightread: an rss client. Good UI designed. If you use a lot RSS, you probably like it. I thinks it needs ubuntu one sincronization.
My judge is based on the description from Software Center of every application, I didn't try these application yet.. and I judged it basing on my first impact watching the description, screenshot and videos(when present).
It is all IMHO :)

Tuesday, 10 July 2012

Mobile OS: need apps...milions of apps!

Everyone wanna do Mobile OS..Blackberry, Microsoft and many others...are trying to get some space in this giant enviroment... because it is the new revolution and maybe mobile (tablet and smartphones) will replace desktop platform in the future.

For many people, a smartphones or a tablet is enough.
People are starting to prefer to use their phone to access internet: because their phone are faster enough and they have dedicated apps.. designed to be easy.
They provide a better user experience.
People can use their phones, without asking to their geeky friends for any trouble, they reach their scope because phones are easy also to reset.
Desktop PC are powerful but noisy, slow, exposed (virus and many problem) = stress & pain for a simple man.
Smartphones is always with you and it can help you in everyday activities, PC only when available.

The main usage of a desktop pc today is open a browser and go to internet..smartphones are enough for many websites and they can accomplish very well this task...and when they are lucky enough there is always an app for a specific task.
We are part of a revolution that will change how we will get information from the net.

The giants
Mobile world is becoming simple everyday.. IOS and Android are the largest platform out there... with so many downloadable apps.
Microsoft is desperately trying to get in.
Desktop platforms are converging to hybrid solution:
  • Apple: new release of OSX contains part of IOS and I thinks one day we will see a unique platform with the best approach of both (with an Apple processor on it). They are driving people slowly to these changes and they are careful. This is the approach that I prefer.
  • Google: they haven't got a real operating system for desktop.. they have chrome os.. but it is a sort of an experiment..Android for desktop is not an acceptable solution. I thinks docking stations for connecting monitor to a smartphones are great things but.. how many do you see out there? Google is just waiting... They have the power to start something from scratch tomorrow and fight with others in any moment.. (see google voice vs siri). They wait and see.
  • Microsoft: Windows 8 is one of the biggest challenge of MSFT. It's a strict parent of windowsphone. If they are right, they can really change mobile enviroment again. What I think? I thinks Metro is a good UI, at least different from IOS, but it is a mobile UI and not good for a Desktop experience (many wasted space and poor aesthetics...).  I don't really like on a tablet, and I really hate on a desktop.. I thinks we will see windows 7 for a long long time.. It is too soon.. but they have enough money for try..I thinks windows 8 is just there to prepare people to windows 9 learning the mistakes from win8, like MSFT did with xbox 1 for xbox 360 (I hope also Nokia will have the power to follow this..change.. or they will die.).
And the others
  • Symbian: adieu.
  • Blackberry: a fact, they can't make mistakes or they are out. For me the biggest mistakes of blackberry was to open to teenager market and forget business people. BB should focus on business services and business tasks and make something new. A BB phone today is a toy like any other smartphones out there. BB years ago was a tool for work, that is why business man liked it.
  • Opensource world: maemo... meego... Tizen... now some  new Firefox OS. It is just crazy to make a new OS and thinks HTML5 will save the world. I don't believe in these revolutions why? read on.
All you need is apps (papaparapa)
Unless IOS and Android.. what platforms need are apps!
Microsoft is trying to become an interesting ($$$) platform for developers.. but the numbers of IOS and Android are pretty different from windows phone.
MSFT is doing the right thing.. pushing people to write apps for them... but it is not an easy task.
I thinks a mobile developer focus more attention for IOS and Android platform now, than he looks the others  platform.

HTML5 apps will not save anyone... because as a developer you have to pay in performance and platform integration (and testing), and HTML5 is just a new technology. So the gain is not enough.
Anyone needs apps and developer who write apps.. so I don't really now how Tizen, Firefox OS and co... can fight with the market numbers of IOS, Android and Windowsphone.
And apart from the hardware of a phone, people don't care about the os, people care about apps!
We wait and see...

Monday, 9 July 2012

Last improvements

I did some improvements in the last 3 days :)
This is how the application UI is now:

I removed the 3 buttons on the bottom and I added a toolbar with the 3 buttons: add, remove, reload.
I've also introduced some unity integration in the app:
  • progress/loading in the launcher
  • quicklists for reload action

Unity integration is easy to do.. but, you have to deal with some problem with .desktop files like this one.
I had also this problem with quickly.
All of these problems are defeatable... but they make headaches.
You've just to ask to the community: there is always someone who can help you if you ask the right question.

I'm very tired after these 3 weeks of programming after-work and I thinks that if there is no problem with submitting, my application is ready as is.
UbuntuAppShowdown is a really nice experience.
My application is not perfect, buy I'm a bit proud of the result... it's not easy to work on this kind of application everyday, scheduling the work to do.
And I've also learned a lot of new things!
Need to sleep now, if you found a bug on protoborsa, please write me!

Thursday, 5 July 2012

The community is the key

Linux and all the software around it, it is one of the most challenging and complex enviroment out there.

You know, what is it really hard? Keep all the things working and coordinated.. because you have to deal with many and many problem that proprietary software don't have.
It is an enviroment, not ready for all, at least for now, because it needs time... but a route is traced and the key of this enviroment, it is the community around it.

You have feedbacks; there is always someone that watch your work, someone that gives you ideas, for improve your application, and I f*cking love this.

Yesterday, I said that I had finally put the ppa on launchpad... but it was not working correctly.. today I have finally upload a working version.
You can find a version here.

Meanwhile someone (Daniel Holbach) watched the code of my application submission on ubuntu software center, and he found a bug on my licence.. many thanks.

This is such a kind of collaborative env, very hard to find elsewhere.

Protoborsa, new update!

Some minutes ago I uploaded a new version whit these changes:

  * fixed Licence file.:
  * improved company search on add stock.
  * fixed first loading of settings.
  * little changed on thread code for future improvements.

but this version, got a bug (damn!)...the first run fail to copy of a settings file to your homedir/.protoborsa/ directory..
You can manually create this directory and copy the /opt/ inside it.. or wait for the new version (protoborsa_12.07.5ubuntu5)... that is on the way, and will be downloadable soon.

I would like to improve my application for:
  • better handling of loading chart with thread support and animation while loading
  • toolbar instead of the bottom buttons: this is just for a better UI integration with Unity.
  • try to add unity quicklists
  • add progress while downloading data, on unity icon.
That's all!

Wednesday, 4 July 2012

First Version is out...!

Finally my application for ubuntuappshowdown is out..
After 2 nights of tests..

It's not perfect.. when you are far from a milestones, all it seems perfect..when you are near to reach the milestones, bugs comes from everywhere!

The application is on a ppa here:

The Name:

So first of all.. my application is called now.. protoborsa.. why this name? because this was the name of the application when I started to hack this project...
I thought that it was simple to change the name of a quickly project in another moment.. but there is no way (let me know if I am wrong please!) to refactor a project and change the name..
So at the end I left this because refactoring for rename is a problematic task. And it is better to don't talk about version... it's  12.07.5 the last uploaded.. LOL.

Quickly submitubuntu is not enough for now
quickly is a young project and so this competition is a good way to test it for bugs.

It's not just (mention from showdown page):
  • Set up a PPA on Launchpad
  • Run the following command to package and upload your app: quickly submitubuntu
 because you need also to:
Other stuff
I spent a lot of time trying to make a good svg icons for the application (the one present in media with the same name of application):  pay attention to make it a 64x64pixel svg (you can create it with inkscape)... not the image.. the entire document...

After that, in order to join the competition you have to upload on Ubuntu Software Center:
  • Create some screenshot of your application
  • Remember to "IMPORTANT! While submitting your app, fill in the App Showdown Participation Details and upload it in the ‘Your application‘ field in MyApps"
  • Create 4 icons: 16x16, 32x32, 64x64, 128x128. You can use a command like this "convert youricon.png -resize 128x128! youricon_128x128.png"
and follow all the steps..


I haven't tryed to download from the ppa and install the application from there and verify if it is all ok or not (application is on /opt and it works...)
I will do tomorrow..
if someone read this and wants to try..
Let me know if it works or not, thanks you.

I think I will spend my resting time to:
  • testing
  • correct bugs
  • improve unity integration

Monday, 2 July 2012

Changes, Changes and... Changes!

The code relatives to chart is finally ok..
Now the program is capable to:
  • plot a chart with the data ordered by date
  • put the correct label on the chart ticks
  • put an explicative label on the axis
  • calculate a good y-range for displaying the chart (see this option of pycha)
  • for every click on one of the symbol on the stocks list, it display the last month of data on the chart.
  • I added a reload button... if you want you can trash all your dowloaded data and download it again.
About pycha: this is the complete list of options and if you want to specify ticks labels, you need to give pycha something like this:


{'v': 0, 'label': 'day1'},
{'v': 1, 'label': 'day2'},
{'v': 2, 'label': 'day3'}


It is a list of dictionary.
so record 0 will have day 1 on the first tick.. and so on...

Tomorrow I will spend my after-work time, trying to put it on the ppa and making it ready for the ubuntuappshowdown!

Last screenshot here:

After that, I will spend my resting time for:
  • finish about page.
  • unity integration.
  • make it possible to change data displayed on chart
  • caching data (I want to reduce queries to yahoo whenever is possible).

I need also some graphics.. for icons at least.