Month: July 2014

Compiling Android ICS on Linux Mint 17

These are some issues I faced compiling Android on Linux Mint 17:
Error:
frameworks/base/include/utils/KeyedVector.h:193:31: error: ‘indexOfKey’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
ssize_t i = indexOfKey(key);

Fix:
vi frameworks/base/tools/aapt/Android.mk

Add ‘-fpermissive’ to line 31:
LOCAL_CFLAGS += -Wno-format-y2k -fpermissive

Error:
external/srec/tools/thirdparty/OpenFst/fst/lib/cache.h:136:11: note: use ‘this->SetState’ instead
make: *** [out/host/linux-x86/obj/EXECUTABLES/grxmlcompile_intermediates/grxmlcompile.o] Error 1

Fix:
cd external/srec
wget “https://github.com/CyanogenMod/android_external_srec/commit/4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff”
patch -p1 < 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff
rm -f 4d7ae7b79eda47e489669fbbe1f91ec501d42fb2.diff
cd ../..

Source: http://blog.csdn.net/yiyaaixuexi/article/details/8330645

Also I installed these programs:

sudo apt-get install multistrap
sudo apt-get install u-boot-tools
sudo apt-get install xsltproc
sudo apt-get install libxml2-utils
sudo apt-get install openjdk-6-jdk
sudo apt-get install libc6-dev-i386
sudo apt-get install gcc-multilib
sudo apt-get install libstdc++-4.8-dev
sudo apt-get install lib32stdc++-4.8-dev
sudo apt-get install zlib1g-dev
sudo apt-get install lib32z1-dev
sudo apt-get install libncurses5-dev
sudo apt-get install libncurses-dev
sudo apt-get install libx32ncurses5-dev

Programa para gravar o numero do telefone no SIM Card

Se você está tentando pegar o número do seu telefone através da chamada:

TelephonyManager tm = (TelephonyManager)this.getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE); 
String phoneNumber=  tm.getLine1Number();

Ela poderá retornar “null” ao invés do número do seu telefone, isto significa que o campo no SIM Card onde fica o número do telefone está vazio. Mais info:
http://stackoverflow.com/questions/5134398/telephonymanager-getline1number-failing

Para resolver este problema basta gravar o número do seu telefone no SIM card:
http://community.giffgaff.com/t5/Tips-Advice/How-to-add-your-mobile-number-to-your-phone/td-p/483867

Você pode instalar o app “My Phone Number” do desenvolvedor Lytsing direto do Google Play, mas ele disponibilizou o código fonte no github:

https://github.com/lytsing/MyPhoneNumber

Hacking Sharp PG-F212X projector to ignore burnout bulb

I decided to modify a projector to become a UV exposure unit to sensibilize a photo PCB (photo-resist coated PCB).

Then I bought a Sharp PG-F212X projector with burnout bulb in the MercadoLivre (“Brazilian’s eBay”). Then searched for projects replacing the bulb lamp by LEDs and found these pages:

http://www.instructables.com/id/Convert-A-Projector-To-An-LED-Light-Source/?ALLSTEPS

www.lumenarc.co.uk/forum/showthread.php?13306-InFocus-LP600-Bypass-lamp-check

Based on this page I realized that it is necessary to short-circuit the pins 3 and 4 of the opto-coupler to force the projector to think the bulb is fine. This tip is for projector InFocus LP600. Then I decided to search for the Service Manual of Sharp projector. I found it here: http://elektrotanya.com/sharp_pg-f212x-l_xr-32s-x-l.pdf/download.html

Analyzing the schematic in the service manual I discovered that the opto-coupler should be that D7715 at page 63, because it was responsable by the N-LIGHT signal.

After removing the projector’s top cover I noticed it was possible to short-circuit the pins 3 and 4 of D7715 without disassembling anything more. Then I just used the iron solder to melt solder there and short-circuit it:

optocoupler_shortcircuited

Then after powering on the projector the Lamp indicator turned green indicating that the lamp was working fine. Now the next step will be adapting a UV LED module as light source!

When to use IF or Whether

I think using if/whether correctly is a little bit confuse for latin people (/me included), because we use just a single word for both case (“se” word).

Then the rule of thumb is: use “if” when you want to introduce a condiction and “whether” when something could happen or could not.

Example:
1) If you sing, I will pay you. //Here you are introducing a condition (I will pay you only if you sing).

2) I will pay you whether you sing or not. (I don’t care if you sing or not, I will pay you anyway).

More info:
http://www.grammar-monster.com/easily_confused/if_and_whether.htm