Category Archives: Programming

Postphone icon

Postphone Android App 1.0 release

Today version 1.0 of Postphone has been released. Nerver forget to call back again!

You can find the promotional page here.

Technically speaking:

  • it has been fully developed under Ubuntu 12.04 64bit
  • it has been written entirely using vim
  • everything has been tracked by git
  • the icon has been edited using SketchUp under wine
  • main and other icons, banners and featured images has been edited with Gimp
  • beta devices were all running CyanogenMod

 

Android

How to find Android deprecated API

The problem

When you compile android apps, sometimes you can see this message:
-compile:
[javac] Compiling 12 source files to /home/max/Projects/Android/postphone/bin/classes
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.

Now, how is possible to find the API call which seems to be deprecated?

The solution

$ ant -Djava.compilerargs=-Xlint:deprecation debug
The above command will show you what you were searching for:
[javac] /home/max/Projects/Android/xxx/src/net/mx17/xxx/Yyy.java:212: warning: [deprecation] getNotification() in android.support.v4.app.NotificationCompat.Builder has been deprecated
[javac] Notification notif = notificationBuilder.getNotification();

Git through a proxy

I was connected to a LAN behind a proxy. When I tried to download something from github I got this error:
fatal: unable to connect to github.com:
github.com: Name or service not known

I’m running latest Ubuntu desktop (12.04).

One way I found to bypass this problem is to create a git proxy wrapper.

  1. Create the script i.e. ~/bin/git-wrapper.sh and configure the 2 variables according to your needs. My proxy is a local service which forwards my requests to the real LAN proxy. Local service is configured to listen on the 5865 port of my local (127.0.0.1) machine.
    #!/bin/bash
    proxy_address=127.0.0.1
    proxy_port=5865
    nc -x$proxy_address:$proxy_port -X5 $*
  2. export an environment variable
    $ export GIT_PROXY_COMMAND=~/bin/git-wrapper.sh

Then you can run your usual git commands.

iphone-gcc: compilare C/C++ su iPhone

Finalmente torna a funzionare gcc sul mio iPhone, stavolta con firmware 3.0.
Prerequisiti

  • connessione internet da iPhone
  • iPhone jailbroken

Procedura

  1. collegarsi via ssh al telefono
  2. scaricare ed installare fake-libgcc

    root # wget http://files.getdropbox.com/u/876743/fake-libgcc_1.0_iphoneos-arm.deb
    root # dpkg -i fake-libgcc_1.0_iphoneos-arm.deb

 

  • installare com.bigboss.20toolchain e libstdc++

    root # aptitude install com.bigboss.20toolchain libstdc++

 

Esempio: Hello world!
Questa è una verifica del funzionamento:

root # cat main.c
#include “/private/var/include/stdio.h”
int main(int argc, char** argv) {
printf(“Hello World!\n”);
  return 0;
}
root # gcc -Wall -I/private/var/include/ main.c
root # ./a.out
Killed
root # ldid -S a.out
root # ./a.out
Hello World!
root #