le Wadablog

Aller au contenu | Aller au menu | Aller à la recherche

mardi 3 janvier 2012

ORMLite for Android - episode 1

If you read my blog, you certainly know I am an Android fan.

But I am not fond of its SQL features. Some times ago, I looked for alternatives and I found ORMLite for Android.
My first use was very simple (yet unpublished).

Recently, I tried it with a parent-child relation. There is a persistent object in another persistent object.

As I wrote in https://plus.google.com/u/0/117007069948230044999/posts/fGyVgXPPf57

After some browsing, I found that parentDao.refresh(parent) must be done explicitly, else the child is not loaded.
Well ... ok ... its weird for me, as I'm used to server-side ORMs.

Unfortunately it did not work with only
@DatabaseField(foreign= true) on the child field (yes, I believe in magic ;) )

so, I annotated it with

@DatabaseField(foreign= true, foreignAutoRefresh = true, foreignAutoCreate = true) and it worked.

I have not tested the updates behaviour yet or the performance as for the moment, I just want to load my db.

This lib is a nice tool for your android toolbox.

vendredi 23 décembre 2011

Exchange, JavaMail & le temps perdu

"Le temps perdu" (the lost time) including extra hours trying to solve this problem ...

I managed to have a sort of "hello world" of email sending working with exchange and javamail.

First, let's make things clear. I'm in a corporate environment. I am forced to use exchange, I have to deal with the proxy, a slow machine and a lack of documentation.
Fortunately, the web access is not too restrained. 

Thank you http://stackoverflow.com !
With all the threads openned on javamail + exchange I could 'compile' something.

If ever that can help someone else than me, here are the ingredients I used (might differ in your environment)
  • use TLS props.put("mail.smtp.starttls.enable","true");
  • use port 587  (not 25, not 685)
  • use a javax.mail.Authenticator
  • add the necessary certificates to the keystore used by your VM

    On a *nix system, try   find / -name cacerts |more
    and find / -name .keystore |more
  • You will find the certificates from your browser settings
Other findings
  • McAffee protection against 'mass emailing worms'  prevents you from developing on your dev station
What I should not write
  • Write simple test programs on the PROD env. to be sure it CAN work
And now a poem
LE TEMPS PERDU (de Jacques Prévert)
Devant la porte de l'usine
le travailleur soudain s'arrête
le beau temps l'a tiré par la veste
et comme il se retourne
et regarde le soleil
tout rouge tout rond
souriant dans son ciel de plomb
il cligne de l'oeil
familièrement
Dis-donc camarade soleil
tu ne trouves pas
que c'est plutôt con
de donner une journée pareille
à un patron?

mercredi 30 novembre 2011

NoSuchFieldError: reportUnusedDeclaredThrownExceptionIncludeDocCommentReference

Got this while compiling my GWT app
Java.lang.NoSuchFieldError: reportUnusedDeclaredThrownExceptionIncludeDocCommentReference

It did not occur when compiling with previous GWT compiler, but occurred with 2.4.0. Another WTF?!?? -- code was unchanged.

A handy message on the GWT Google group says that the order of export put in place by Maven was guilty.
I up-ped the GWT dev and user JARs
 with my answer

mercredi 9 novembre 2011

Alfresco - install on a linux VM, protip from real life

As I was installing an Alfresco on a Linux machine, I learned AGAIN.
Damn Alfresco, I know it since the "not yet 1.0" version (was 0.6??) and everytime I use it, I learn new stuff.

Problem:
It all started with my test user seeing mixed languages, English and French in the web interface despite the choice of English at login time. 


OK, problem is solved but it was a pita as I had to "DROP DATABASE alfresco;". Was empty, fortunately.

Short version :
As the "system spaces" like "data dictionnary" are created upon first boot of the webapp, you must not leave YOUR language packs (.properties files) in the .war file. Main culprit was bootstrap-spaces_fr.properties in alfresco.war\WEB-INF\classes\alfresco\messages\

Long version :
I installed on a Linux machine, not using the 1-click installer provided by Alfresco but it would not have changed a thing considering it's the .war file the guilty.

I am not a US resident, nor EN.
I use a Linux VM that I have not set up, physically located in fr_FR, which I tend to forget as I mostly write/code in english (sometimes frenglish).

On first start, the .war file deployed in Tomcat is unpacked and its content is used by the initial process -- including the deadly bootstrap-spaces_fr.properties. 

This process creates what I'll call the "system spaces" (like "data dictionnary") and they are created accordingly to the locale whenever the files are available. If not, the default are used and they are plain English, which is better for a system to be used by people around the world.

The culprit file can be found at alfresco.war\WEB-INF\classes\alfresco\messages\bootstrap-spaces_fr.properties. I moved all _fr.properties files to a subfolder -- just in case.

My advice is to remove all I18N files from the .war before to use it.
Or, you'll have to drop the database and empty the alf_data folder and of course, bear with another looong first start. 


Hint: Setting the JVM's locale to "en_US" could be an option (not verified) at install time.

jeudi 9 juin 2011

The Sam Tab 10.1

As I have already said, I am the happy owner of a Galaxy Tab 10.1 :D
This may sound like a conclusion but do not stop reading yet.

It runs Android 3.0 for the moment and I have not used it for hours and hours ...

My main expectation with this device was access to the v3 API branch, due to the slowness of the emulator on my C2D laptop.

However, since I have received it, I have not had time to code :(

Still I had enough time and concentration to test a few apps.
Thus, the apps cons

  • browser : it closed automatically too often.
  • Maps : it closed automatically too often. Too. Seems multitouch is a cause.
  • market : have not found the "only free apps" checkbox.
  • tweetdeck : a font size superior to the max. of 27 would be cool.
  • gmail : a few times, the "reply" button did not work ....
  • Helix HD lite free : slower then on the EVO on which I usually play
  • Robo Defense : I prefer to play on the EVO too. Even if it drains the battery.

That's it for the general cons.

Now the general pros :)

  • beautiful object
  • very responsive (had previous exp. with cheap tablets. Used several in stores)
  • approved by kid, haz passed the "haz angry birds" test :P
  • good sound


On the "general cons" side.

  • one non-standard connector (is it direct to mainboard ?)
  • does not recharge during use (wtf ?)



However, this is balanced by

  • "toys, toys, toys" --- I like toys
  • the newest, the better
  • I USE IT
  • I plan to code for it specificly.



I expect more stability with the announced 3.1 OTA. Despite the listed cons, I am an happy owner.

Thanks again Santa ;)

mercredi 27 avril 2011

Android recycling

This post is not about teaching a phone to eat all your waste :)

What to do of "old" phones

As time goes by, one (developper) gets more and more smartphones and specs evolve, leaving older phones behind in terms of daily use.

Thus the question that arises is what to do of "old" phone ?

Of course, the quick and easy answers are :

  • let it rest in a drawer for ... hum ... future use.
  • give/sell it to someone


What else ... ???

HACKING !

There is a computer in the phone ! Remember ?
Depending on the phone model and the work done for it by the wonderful community, you can :

  • install another system, like Ubuntu on a Nexus One
  • install uncommon services
  • use as a remote home-monitoring system (camera to take pics periodically and upload to web if delta)
  • Experiment (roms, ...) : nice way to learn


To give an example to that second point, it would be to install a web server with a few pages, tie it to a dynamic dns (you'll need to configure your box/modem of course)

There is web servers for Android, you are not forced to install Ubuntu + Apache :) or even to cook your own.

It all depends all your available time

That is how innovation happens.

Maybe one day, we'll see Tomcat running on a mobile phone without slowing it to death.

jeudi 24 mars 2011

(FR) Application "Contrepeteries" pour Android

Entre autres choses, j'apprécie les traits d'esprit et les jeux de mots.
Il y a quelques années, je me suis intéressé aux contrepeteries et j'ai constaté que le web n'en manquait pas, mais qu'il y avait souvent les mêmes, dupliquées de sites en sites.
J'ai initié le site http://contrepeteries.free.fr pour qu'il soit collaboratif : que les visiteurs l'enrichissent et puissent récupérer les contrep's pour les utiliser sur d'autres supports.
Il y a eu des échanges fructueux avec le créateur d'une appli pour mac, des visiteurs qui ont beaucoup participé (Merci encore à Maud du fond du champ).
Mais le site vivote à 50 visites par jour.

Comme dirait le chien parlant que je n'ai pas : ça c'est de la niche !

A partir des données de mon site, j'ai créé une appli pour smartphones Android.

Elle s'enrichira au fil des versions. Aujourd'hui (v1.1), elle permet de

  • consulter +500 contrepeteries au hasard
  • partager la contrepeterie affichée (par mail, facebook, twitter, etc ...)
  • voir la liste des évolutions à venir (affichage des solutions est l'évolution la plus demandée)


Voici le lien vers le market web https://market.android.com/details?id=org.wadael.contrepeteries

Et le QR code correspondant

Amusez-vous bien et donnez-moi votre avis.
Merci

lundi 14 mars 2011

Android Market & efforts

Today,
I have decided to publish a small app dedicated to spoonerisms (in French).

It is titled "Contrepeteries".

Another day, another occasion to learn.
I built apps mostly for myself so this was the occasion to 'market' an app.

From my coder point of view, it is quick but not as direct as should be.

Guess what, after all the ProGuard errors solved (thx to Guillaume of Capptain), I had errors on installing my own app !

"not signed correctly"

"Damn how can it be ?" I thought, considering I was using the very last version of the tool provided.
Isn't it checked right after I upload the apk ?

Based on what I've read on the web and this experience, what one must do is :

  • clean the package before signing (remove useless files)
  • uninstall from your test phone before to install from the market.



Coming back to the ProGuard point, as I use Capptain and AdMob on this app, a working proguard configuration can be found at https://docs.google.com/document/d/1r-zv0XDsJNDmkuhQYTNRW2Tv46WOSBV0QAA3hHcN3IM/edit?hl=en


Find Capptain at http://pages.capptain.com/homepage_01/

Find my app at https://market.android.com/details?id=org.wadael.contrepeteries

lundi 15 novembre 2010

Drops computing

I do not intend to produce a reference material with this blog post. At most, I'll get 'prior art' reference and avoid a corporation to patent this. 

Definition

Yet another "new" term for IT. 

What I mean with this "drops computing" is "distributed computing involving both machines 'in the cloud' and smaller connected machines like smartphones".

My point is that global computing power has grown in an important way in the last years. I am thinking of all the smartphones that have been sold lately.
What a waste of power to have them mostly do ... phone calls.

Nowadays, smartphones have capacities that sound similar to desktop PCs available a few years ago.
Altough they have different CPU architecture and less storage, I think you'll agree.

Do you remember that those PCs were used for distributed calculations via programs like Seti@Home ?
Whether it is decrypting alien gossip or the human genome, computing power is here, in our pockets.

Limitations

Battery

Description 

Imagine continuous usage of the phone. Battery would drain quickly.

Solution

Calculations only happen when the phone is charging OR battery level higher then a percentage to be determined by user.


Complexity

Description

Smartphones cannot hold a complex model in memory.

Solution

Give "easy jobs" to smartphones.

Network

Description

Connectivity is not always available.

Solution

Be honest. Advise users without a real unlimited data plan not to join. 




Side note :
An architecture involving cloud computing machines and portable machines (drops) could be called "rain computing". But that would not be a very bankable term.

mardi 19 octobre 2010

Smudge attack parade ideas

I have read a post from Eric Vetillard (javacard expert amongst all and a colleague), about smudge attack against android terminals.

To quote his post :

this attack targets the authentication pattern that is used to unlock an Android phone. .... owners also know that smudge really is dangerous for this authentication technique. I have tried it with a colleague: after picking up my phone, it took him 3 tries to get my combination

Why that ? Because :

  • fingers are sweaty or greasy or both (weather is good in the south of France, isn't it Eric ?) so they leave traces on our shining screens
  • there is only one path to unlock the phone
  • this path 'looks' always the same on the phone



So, that post triggered some thinking. I think I've found possible solutions :)

First proposal
The pattern has to not be static. To reach that, my proposal is to have the dots or equivalents to be in a circle that will rotate.
Not randomly but more like a compass.
Just like a compass has an arrow, an arrow is used so that the user has a landmark and not get lost
Then either link the dots to unlock. (5 tries are allowed instead of 3)
With that, you will never not touch the screen at the same place (unless you unlock only at the very same place, with the same position of the body)
Derivated proposal :
A keyboard which keys are never at the same place, used to enter PIN code.
Most of us already know that, as this is used by online banks. The proposal is to integrate it as a proposed unlocking system.

Third proposal, I call it the psycho-camembert :)
It looks like a camembert (or pie chart) with equal parts coloured differently and having patterns (stripes, dots, etc ..).
This camembert is centered on the screen. Those parts are displayed in a random order.
To unlock, parts have to be dragged toward the exterior. Therefore, the traces on the screen are all lines from the center to the outside.
Of course, its a memory thing and one will have to memorize a colour order. Sorry for those who cannot distinguish colors, thats why patterns can be added.

I hope this contribution will find its way to the good ears.
Let's be frank, all the better if it brings me an all-inclusive invitation to IO 2011 !
I really liked San Francisco and have no idea on how to deserve an invite for next year.

Feel free to indicate me the classes of the API to look at in order to implement it.


Cheers,

Jérôme


Eric's post is here http://javacard.vetilles.com/2010/10/18/smudge-attacks-on-android
You can follow Eric on Twitter : @evetillard http://twitter.com/evetillard

mardi 14 septembre 2010

DIY - Memory extension for long-haired people

Hi all,
this post is the first of my DIY serie, it reveals the "geekweller" (geek + jeweller) in me.


It's goal is to realize THIS ! An astonishing memory extension for people !


This not only a hair barrette (or hair slide, I'm not sure of the English for this) but by the mighty power of the Coué method, it is also a memory extension for people !

Let me stress this, it is for people not for your Afghan hound ! It has absolutely no effect on dogs.

So what do we need for this ?

Parts & tools & ...

The most obvious components are a RAM bar and a barrette. The RAM bar used here certainly comes from far in the past, as it was an incredible computer part when the 386 platform appeared. However, the size is perfect and it is symetric then beautiful.

The barrette comes from a broken barrette, but you can find new one in the shops my wife like, like (the expensive) 'Loisirs & créations' in France.

We will need some strong glue, we aim to glue plastic with metal.
Look at your glue's description.

And a heat source and that's all. It can be candle, gas from the kitchen.



Steps

Bending

Maybe there is no spoon but there is somme bending to do so that the RAM bar gets the same curve as the barette.

To reach that goal, I did several trials of bending it above the gas in the kitchen, holding it by the side with tools (plier and pincer). 

If you are above the minimum age for that manipulation, be cool and it will be ok, do not burn yourself and beware of possible fumes.

This step ends when the curves of the barrette and the RAM bar match.


Gluing

Let the bar cool down so not to burn your fingers. Then, glue the bar and the barrette. I used clothespin to do the holding

Admiring

Et voila !  You now have the RAM extension you always desired ! Never forget important things anymore !



Prologue

I am like a red fish sometimes, thus the idea of that barrette but I have short hair :) so I use my smartphone to store data like birthdays, meetings, et caetera ...
All the more I own a Nexus One that has way more memory than that 1 Mb bar :)

I might update this tutorial with more picture if you beg for it in the comments.


Jérôme

vendredi 3 septembre 2010

Wave in a box

Wave open source next steps: "Wave in a Box"

As announced here, the project will contain : 

  • an application bundle including a server and web client supporting real-time collaboration using the same structured conversations as the Google Wave system
  • a fast and fully-featured wave panel in the web client with complete support for threaded conversations
  • a persistent wave store and search implementation for the server (building on contributed patches to implement a MongoDB store)
  • refinements to the client-server protocols
  • gadget, robot and data API support
  • support for importing wave data from wave.google.com
  • the ability to federate across other Wave in a Box instances, with some additional configuration
This is fantastic. This means possible company-wide + company-only Wave servers.
Very good ! A nice start for a friday today !

Most of the world will not care but "robot support" means that the time I spent on the WadRobotFramework will not be have been wasted. 

Jérôme / Wadaël

lundi 9 août 2010

Goodbye to Wave

As you may know, Google Wave will be stopped by the end of the year.
For sure, that's a bad surprise.
RIP Google Wave  20 May - 4 August 2010

For me, it means that the WRF ends too. Actually, it ends now.
Sure, there's plenty of time between now and december but I have already spent a lot of time on WRF.

The generator may find a second life, who knows ... it's only the templates that must be changed.

However, WRF was a very good experience for many things.
First is my collaboration with Romin  (@iRomin), who has become a friend. Mon ami, our daily (live) exchanges through Wave were lots of fun and knowledge sharing.

I gained pride as WRF was for a long moment (during the V1 days) the subject of three (from eleven) articles listed on the dedicated page on google's site.

Not bad for a project done little by little on my sleeping time (meaning I was often half asleep while coding)

Thanks to @fbaligand, I had the occasion to speak of WRF during the "JumpCamp 4 IT" event in Paris. My first public speaking since ... long ago.
I proposed to present WRF and a usage of it at the Devoxx 2010 conference. Well, no answer yet but I think I know it.
I really wanted a MAJOR speaking experience to push my limit. Too bad. Have to create something else.

During Google I/O, I have met people who followed me on twitter and knew my project, have met googlers IRL, spoke of WRF to some of them.
I even chatted with Vic G (fantastic speaker) !
 
Incredible San Francisco where three French guys named Jérôme can stand in the same square-meter (have a look at SnapABug.com). That never happened to me in France as Jérôme is a quite rare first name.

About Googlers, Wave's DevRel @pamelafox is a fantastic I.T woman. Talented, funny, clear minded and such a good speaker.

I am certainly forgetting other + points about the WRF episode.

Overall, the Wave experience was very good for me that's why I am so bitter that it's over.
So, goodbye Google Wave, rest in pieces, we'll meet again.
 

mercredi 30 juin 2010

First ADvertisement for the WadRobotFramework

I have recently know about the site http://www.xtranormal.com that allows to create movies via a website.
You certainly have too, due to the buzz with the 4G/Evo video. 

So, as I saw robots being available as actors, a bell ringed and I did a short movie about my WadRobotFramework
I managed to have it published for free after the deception of the will-have-to-pay feeling (must be by changing of actors and background).
I've also put it on youtube. 
In less than a minute, it will not teach new stuff if you are already experienced with the WRF but I hope you will find it funny.


So, if I remember a conversation I had with @didiergirard (who coined the Geek 2.0 term), I think that 'creating an ad' is one more line to add to the todo-list of actions that should go along an opensource project :
  • create a dedicated twitter account
  • create a dedicated website
  • speak of it
  • (and more)
Have fun with the video !
On YouTube  or on xtranormal.com


I'll definetely have a go with the desktop software of xtranormal


Jérôme

jeudi 17 juin 2010

Android : OffLine Map App

If, like me, you use your 'Droid only in wifi mode then you may regret not to be able to use google maps whenever you get lost, outside civilization, far from a wifi access-point.

Then the MapDroyd app was made for you.
After an initial/install-time download of the "Open Street Map" project's maps relevant for you, you are ready to go

For the moment, it is not on the market but available at http://www.mapdroyd.com/

Jérôme

jeudi 15 avril 2010

A wave for the WadRobotFramework

Hello,

There is now a wave about the wave robot framework ! But, as scripts do not work in this blog, got to Wave and search for WadRobotFramework



The page at http://thecodersbreakfast.net/index.php?post/2010/04/15/Google-Wave-Embedded-:-Mise-%C3%A0-jour will show you how to embed a wavelet on your website.

// //

lundi 15 février 2010

A cool logo ...

Hi,

I know I am a right-handed guy with two left hands, I cannot draw. That's a fact.
Too bad, I have other talents or so I think.

I need a logo for my framework.
The name is "WadRobotFramework".

Here are a few constraints : (may evolve of course)

  • no aggressivity
  • no skynet/terminator stuff
  • metal
  • pop shiny colors too
  • robot comes out of a box (?an eclipse logo on it ?)
  • a taste of 50's sci-fi would be nice
  • MGM-like, a roaring robot :)



I forgot. I have a budget for this although free cooperation to the project would be credited.
My budget is small but fair. I can pay with a French check or through PayPal.

Send me your estimation and sketch.


Cheers,

Jérôme

dimanche 24 janvier 2010

WadRobotFramework, les slides en français

J'ai publié les slides de ma présentation sur mon WadRobotFramework sur SlideShare.net

 Quelques anecdotes sur cette présentation :
  • La sortie vidéo de mon portable n'a pas fonctionné
  • Le portable prêté est tombé en panne de batterie
  • J'ai utilisé une version non corrigée de mon framework




Mais je m'en suis bien sorti quand même, j'ai rencontré des gens passionnants et même une célébrité (@didiergirard), revu ce taquin de @fbaligand. Il a raison sur le fait que c'est la troisième présentation sur Atmosphere que je rate.
Faudra m'en faire une pour moi tout seul, Fabien.

Voici les slides


lundi 4 janvier 2010

WRF - WadRobotFramework v1.1 is released

WRF Version 1.1 is released.

It features the robot generator. See wiki for instructions.

A near complete robot can now be generated in a few seconds, reducing even more its TTC (time to cloud).

Logic implementation has still to be done by the user. Sorry about that.

Tweak TWO (or even one) .properties file, run a target and voila !


How ??
First, build.properties (once for a workstation)
then, generator/generator.properties (once for each robot)
and
launch one of the following Ant targets (in build.xml)

# generate_SimpleAppenderRobot
# generate_SimpleModifierRobot
# generate_AdvancedRobot


According to the type of robot you want (see wiki).
On-screen instructions will tell you which files to modify (for the logic part).
The project's wiki proposes instructions for both generating and using the generated robot.

Enjoy and give feedback. Thanks.

Jérôme

vendredi 11 décembre 2009

WadRobotFramework : QuickStart archive published !

Hi,
I have published a ZIP file containig an Eclipse project that is nearly ready to deploy.
A few adjustments to your station are still necessary.

Please look at the QuickStart wiki page for details, you will find the ZIP on the homepage and under the Downloads tab.


More to come : I am working on the Ant script that will generate entire project through a few inputs.

Bye


Jérôme


- page 2 de 3 -