lunes, 1 de septiembre de 2014

Making pdf files with portrait and landscape pages at the same time

Right now I am the president and administrator of my building homeowners association.
Every month I send by mail a pdf with the accounting details and the list of owners with unpaid debt.
Long time ago both things were fitting in just one landscape page, but as the debt is growing, it needs its own portrait page just for it.
As accounting details are in a landscape page, the problem is how to make a single pdf ...
https://www.pdflabs.com/docs/pdftk-cli-examples/
http://www.maketecheasier.com/combine-multiple-pdf-files-with-pdftk/
No problem if 1.pdf is landscape and 2.pdf is portrait ...
pdftk file1.pdf file2.pdf file3.pdf cat output newfile.pdf

Another idea: generate a jpg from pdf. I would like to send them to some owners by Whatsapp, with does not allow pdf.
http://ubuntuforums.org/showthread.php?t=1965114
 convert -quality 100 -density 600x600 multipage.pdf single%d.jpg

domingo, 31 de agosto de 2014

GPS coordinates conversion: practical use in Spain, SigPac

Without my mediatek GPS working properly, I have found in my SD card several screenshots of GPS coordinates: several months ago I was in a house in the country and I was asked to use my GPS to verify if the boundaries where ok, as the owner was suspecting the adjoining property have moved several meters the boundary ... in his own benefit.

I didn't have any special GPS application installed in bada, so I just take some screenshots, waiting to the GPS accuracy indication was 0 m.
The GPS provided data with latitude and longitude, with decimals, as well as altitude.
In Spain, there is a web application to see land distribution, and it has HTML5 interface, SigPac 
http://sigpac.magrama.es/fega/h5visor/

There are several interesting options:
- To see as a vectorial layer "parcelas" (plots) boundaries
- To search for a location: "Consultas > Buscar > coordenadas", where just UTM coordinates are allowed.
There is a "Radio" (radius) option, with 10000 as default value: it is zoom dependent. With a 100 value the zoom value is 18 (maximum is 20). 
- Query a point's coordinates: "Consultas > coordenadas del cursor"


With GPS captured coordinates points , I convert them to UTM:
http://boulter.com/gps/
http://home.hiwaay.net/~taylorc/toolbox/geography/geoutm.html
I take a plot's screenshot and with Inkscape, I draw over it the points with the captured coordinates (Sigpac shows on the left bottom corner the coordinates, and I draw "approximately" in Inkscape the corresponding point in the screenshot)

With that, I have a new boundary line ... and it seems the neighbour has moved in some points almost 3 meters the boundary ...

viernes, 29 de agosto de 2014

QR Code as whatsapp profile image

I was searching an image for my whastapp profile... but without my photo
And I have had an idea: a QR code image with an url

https://www.the-qrcode-generator.com/

It is really simple, tested and it works with
https://play.google.com/store/apps/details?id=me.scan.android.client&hl=es

jueves, 28 de agosto de 2014

GPS Mediatek second session

Looking to
https://play.google.com/store/apps/details?id=com.Double.FasterFix
which I think it is similar to FasterGps already tried, I see that

**Not for usage on phones with android 4.2 or newer**

I do not see that information in XDA forum, where it seems do the same trick with NTP server in gps.conf
http://forum.xda-developers.com/showthread.php?t=825717

Another post
http://androidayuda.com/2014/06/16/como-solucionar-los-errores-del-gps-en-procesadores-mediatek/

So I decided to change /system/buid.prop adding
dalvik.vm.execution-mode=int:fast
After reboot
shell@android:/ $ getprop dalvik.vm.execution-mode
int:fast
But it does not work ...

Another link in spanish
http://www.htcmania.com/showthread.php?t=650161
where there is a link to the following gps.conf

NTP_SERVER=es.pool.ntp.org
NTP_SERVER=0.es.pool.ntp.org
NTP_SERVER=1.es.pool.ntp.org
NTP_SERVER=2.es.pool.ntp org
NTP_SERVER=3.es.pool.ntp.org
NTP_SERVER=europe.pool.ntp.org
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin SUPL_HOST=supl.google.com
SUPL_PORT=7276
C2K_HOST=default
C2K_PORT=0
ENABLE_WIPER=1
INTERMEDIATE_POS=1
ACCURACY_THRES=5000
CURRENT_CARRIER=common
DEFAULT_AGPS_ENABLE=TRUE
DEFAULT_SSL_ENABLE=FALSE
DEFAULT_USER_PLANE=TRUE


After adb pushing this file and reboot ...  future tests in street.

Another app ... it allows to have the GPS search as a service permanently
https://play.google.com/store/apps/details?id=tisinadev.activegps&hl=es

Information link explaining several concepts
http://www.cnx-software.com/2013/11/27/how-to-fix-slow-gps-lock-on-mediatek-mt65xx-based-smartphones/

miércoles, 27 de agosto de 2014

Getting apk info to get info about app compatibiliy in Google Play ... and solving Google Maps library issue / Google Play incompatibility

With this info
http://www.androidpot.net/download-apk-files-from-playstore-to-pc
I am able to download apk
http://apps.evozi.com/apk-downloader/?id=es.openbank.apps
Opening it as a zip file, there is a file

AndroidManifest.xml
But it is encrypted ...
http://stackoverflow.com/questions/4191762/how-to-view-androidmanifest-xml-from-apk-file
Trying to get some info with aapt as one comment in previous link suggests

You can directly use aapt l -a name.apk command to see the manifest.xml.

Where to download just aapt:
http://stackoverflow.com/questions/5441172/download-of-just-android-aapt-for-debian-5-0

Running ok in ubuntu 14.04 64 bits (with libs for 32 bits already installed)
./aapt l -a es.openbank.apps.apk  
Partial output related with manifest and screen


Android manifest:
N: android=http://schemas.android.com/apk/res/android
  E: manifest (line=2)
    A: android:versionCode(0x0101021b)=(type 0x10)0x3
    A: android:versionName(0x0101021c)="2.2" (Raw: "2.2")
    A: package="es.openbank.apps" (Raw: "es.openbank.apps")
    E: supports-screens (line=7)
      A: android:anyDensity(0x0101026c)=(type 0x12)0xffffffff
      A: android:smallScreens(0x01010284)=(type 0x12)0xffffffff
      A: android:normalScreens(0x01010285)=(type 0x12)0xffffffff
      A: android:largeScreens(0x01010286)=(type 0x12)0xffffffff
      A: android:resizeable(0x0101028d)=(type 0x12)0x0
    E: uses-sdk (line=14)
      A: android:minSdkVersion(0x0101020c)=(type 0x10)0x8
    E: uses-permission (line=16)

...
Or even better
./aapt dump badging es.openbank.apps.apk
Partial output
supports-screens: 'small' 'normal' 'large'
supports-any-density: 'true'
locales: '--_--'
densities: '120' '160' '240' '320'


So it is not density ...?

Another idea

$ adb install es.openbank.apps.apk
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
5401 KB/s (1277229 bytes in 0.230s)
    pkg: /data/local/tmp/es.openbank.apps.apk
Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY]


Reviewing output of
./aapt l -a es.openbank.apps.apk  
I see this
      E: uses-library (line=49)
        A: android:name(0x01010003)="com.google.android.maps" (Raw: "com.google.android.maps")

And it seems logical, as app uses google maps ... and I do not have them installed
After installing google maps from Google Play, same message
So it seems to be a low level library outside apks...
https://groups.google.com/forum/#!topic/android-developers/eUbKzSJOwxo

Right, you have to consider Maps has a system-level library that can
be present or not present on devices.

 ...
Maps.jar is never added to your apk.


and this seems to be the solution

http://forums.crackberry.com/bb10-android-app-sideloading-f279/how-fix-any-android-app-dependent-google-maps-api-make-maps-working-862184/

With adb shell, I check there is no /system/framework/com.google.android.maps.jar in phone. There are a lot of jar, and most of them also with .odex extension...I see this post with reference to this file and permissions, but nothing about .odex
http://forum.xda-developers.com/showthread.php?t=1382925

So I extract from gapps-jb-20130812-signed.zip the files
/system/framework/com.google.android.maps.jar and /system/etc/permissions/com.google.android.maps.xml, and I move them to the phone.

Restarting, android says "updating android, app 1 from 29!?"
And ... it works!
No problem installing from adb and running
$ adb install es.openbank.apps.apk
4342 KB/s (1277229 bytes in 0.287s)
    pkg: /data/local/tmp/es.openbank.apps.apk
Success



After uninstall, Google Play incompatibility message is gone

Another example:
https://play.google.com/store/apps/details?id=kr.sira.measure&hl=es
It says it is not compatible, but apk installs ok with adb
$ adb install kr.sira.measure.apk
5640 KB/s (2666341 bytes in 0.461s)
    pkg: /data/local/tmp/kr.sira.measure.apk
Success
But app does not work, because it says it needs a magnetic sensor

Android version and others things changed in Settings >System > About phone

References
http://forum.xda-developers.com/showthread.php?t=1948558

Editing /system/build.prop ...taking risk, without a previous ROM backup:

Before
ro.build.version.release=4.4 After
ro.build.version.release=4.2.2
It works ok after reboot...


I have the idea to change it to android 5.0 :-)
With that result I am no longer afraid to change ro.* properties and to try if Google Play no longer complaints about compatibility  ...
So I change (I decided to use the model where it was working with badadroid)

-ro.product.model=GT-S8500
-ro.product.brand=samsung
+ro.product.model=316
+ro.product.brand=dingcheng
-ro.product.manufacturer=samsung
+ro.product.manufacturer=dingcheng

-ro.hw.version.custom=MT6572
+ro.hw.version.custom=MT6589


After reboot, system info is updated

But clearing data and cache from Google Play app, app is not working, so it may be resolution ...

Update: I change model to G7108 in order to clarity ... two GT-8500 devices with a fake one is a little bit confussing

 

English posts

After a week posting, I have an idea: English posts
Why?
- I have been posting daily, so it will let me practice my writing ... I just practice English reading.

- There are visitors from other countries (USA, Poland), and in this way maybe my posts could be more useful; I will have to change  language to English in my phone for screenshots

Edit: after that http://sesionesfrikis.blogspot.com/2014/08/configurar-blogger-en-google-analytics.html I do not see any visitor from USA and Poland, so thinking about it, I am afraid these entries are not really human.
- Google bot from USA?
- Bing bot from Poland? In this link they think it is a hacker?...http://forums.fedoraforum.org/archive/index.php/t-275016.html