tag:blogger.com,1999:blog-53150176024647630022024-03-09T18:46:21.807-08:00One developer's blogdroid develophttp://www.blogger.com/profile/08282691307280725595noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-5315017602464763002.post-9523666646847490212012-09-20T08:02:00.002-07:002013-11-15T15:30:36.896-08:00<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="text-align: left;">
Fake GPS FAQ </h2>
<br />
I've got a
lot of messages about the same issues from different people every day. I
decide to write the answers once in a one place instead of writing tons
of replies. If you found a new issue which is not in the list below -
feel free to contact me.<br />
<br />
<h4 style="text-align: left;">
Q: I've got my phone stacked at the last faked location<br />Q: My phone can't fetch the real location<br />Q: After uninstalling your app I still got wrong location even after factory reset</h4>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
All
of this are the same issue which happened with you when you forgot to
disable "Wireless/Network location provider" as it's recommended in the
description. Don't worry - yout gps sensor is ok. Read this article to
understand why you are pinned to a wrong location after playing with
Fake GPS:<br />
<a href="http://www.zdnet.com/blog/networking/how-google-and-everyone-else-gets-wi-fi-location-data/1664">http://www.zdnet.com/blog/networking/how-google-and-everyone-else-gets-wi-fi-location-data/1664</a><br />
<br />
You have two options to do:<br />
1st way:</div>
<ul style="text-align: left;">
<li>Enable "Wireless/Network location provider" back</li>
<li>Install "GPS status" app from Google Play</li>
<li>Get a fresh GPS fix </li>
<li>Wait for 24 hours (may be less) until google updates your Wi-Fi access point's location (don't use Fake GPS during this time)</li>
<li>When you've got it and wish to continue using Fake GPS remember to DISABLE "Wireless/Network location provider" to avoid this issue in future</li>
</ul>
<div style="text-align: left;">
or <br />
2nd way:</div>
<ul style="text-align: left;">
<li>Add "_nomap" suffix at the end of your Wi-Fi access point name. E.g.: "JohnSmith" => "JohnSmith_nomap"</li>
<li>After that you can enable "Wireless/Network location provider" back without any future issues</li>
</ul>
<div style="text-align: left;">
This force google not to use your
Wi-Fi access point to determine your location. But you may find that
GPS stop working in your premises. So don't use this method unless you
understand what you are doing clearly. For more details see <a href="http://googleblog.blogspot.com/2011/11/greater-choice-for-wireless-access.html">http://googleblog.blogspot.com/2011/11/greater-choice-for-wireless-access.html</a></div>
<div style="text-align: left;">
<br /></div>
<h4 style="text-align: left;">
Q: It doesn't work with MLB At Bat!</h4>
<div style="text-align: left;">
MLB
At Bat uses double check of your location: GPS location + GeoIP
location. The second one means they can get your rough location by your
IP address (issued by your local internet provider) and black you out
so. The only way to cope with it is using Fake GPS paired with a VPN
service that could replace your external IP address with a new one. But
if the new IP address match an area which is blacked out too you'd try
to use another VPN provider.</div>
<div style="text-align: left;">
<br /></div>
<h4 style="text-align: left;">
Q: It doesn't work with Google+</h4>
<div style="text-align: left;">
When
you tap a location button and see that yes/no dialog - just press back
and you'll got a list of places near your faked location. You should
have "Wireless/Network location provider" option disabled to do this.<br />
<br />
<h4 style="text-align: left;">
Q: It stopped working after some time</h4>
Go to the Settings and check the Accuracy value - it should not be zero! If it is - set it to 1 meter or more.<br />
<br />
<h4 style="text-align: left;">
Q: Where can I find apk for the donate version </h4>
For Android 4.1 and higher google stores paid apps on a local device in an encrypted way. More details can be found at <a href="http://nelenkov.blogspot.com/2012/07/using-app-encryption-in-jelly-bean.html">http://nelenkov.blogspot.com/2012/07/using-app-encryption-in-jelly-bean.html</a><br />
So the apk for donated version can be found at <b>/mnt/asec/com.lexa.fakegpsdonate-1/pkg.apk</b> Note please that "-1" at the end of the package name could be any other number. You should do the follow steps:<br />
- copy apk to SD card<br />
- install application from apk on SD card<br />
- you'll get /data/app/com.lexa.fakegpsdonate.apk which could be moved to /system/app/<br />
On some devices it is necessary to set permission to 644 and reboot your device<br />
<br />
<h4 style="text-align: left;">
<b>Q: Moving apk to /system/app/ doesn't work on Android 4.4 kitkat</b></h4>
<div style="text-align: left;">
You should put apk to /system/app-priv/ instead</div>
<h4 style="text-align: left;">
<b>Q</b>:<b> Does your app have a command line support (Donate version only)</b></h4>
<div style="text-align: left;">
Yes, you can start and stop Fake GPS using command line only:</div>
<div style="text-align: left;">
<br /></div>
<b>am startservice -a com.lexa.fakegps.START -e lat 56.1234 -e long 44.0011</b><br />
<div style="text-align: left;">
</div>
<b>am startservice -a com.lexa.fakegps.STOP</b></div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
</div>
<div style="text-align: left;">
If you don't want to save location in the History just add <b>--ez no_history true</b> to a start string</div>
<div style="text-align: left;">
<br />
<h3 style="text-align: left;">
</h3>
<h4 style="text-align: left;">
<b>Q</b>:<b> Tasker integration (Donate version only)</b></h4>
To start Fake GPS at (38.89765, -77.0365) <br />
1.<b> </b>Create a new task and entitle it "Start Fake GPS"<br />
2. Add Action -> Misc -> Send Intent<br />
3. Fill fields:<br />
- Action: com.lexa.fakegps.START<br />
- Extra: lat:38.89768D<br />
- Extra: long:-77.0365D<br />
- Target: Service<br />
<br />
To stop Fake GPS use<br />
- Action: com.lexa.fakegps.STOP<br />
- Target: Service<br />
<br />
You can use variables to specify lat/long as well. Please remember to add "D" to extras to specify it as Double</div>
</div>
droid develophttp://www.blogger.com/profile/08282691307280725595noreply@blogger.comtag:blogger.com,1999:blog-5315017602464763002.post-34229558024408651442012-04-11T02:14:00.000-07:002012-04-11T02:14:34.144-07:00Почему отваливается VPN<div dir="ltr" style="text-align: left;" trbidi="on">При работе периодически отваливается VPN. Поднять заново недолго, но когда по 20 раз на дню ... Глянул в логи - при отваливании пишет:<br />
nm-pptp-service warn[decaps_gre:pptp_gre.c:331]: short read (-1): Message too long<br />
<br />
Погуглил я на эту тему - и вот что обнаружилось:<br />
<a href="http://i-heart-geek.blogspot.com/2011/06/solved-vpn-short-read-1-message-too.html">http://i-heart-geek.blogspot.com/2011/06/solved-vpn-short-read-1-message-too.html</a><br />
<br />
Солюшн оказался простым - в VPNовском фрагменте сети может быть установлен меньший MTU (maximum transmission unit), чем у нас - в результате мы и получаем у себя Message too long.<br />
Чтобы найти правильное значение MTU нужно сделать traceroute на интересующий узел VPNа:<br />
<span style="font-family: "Courier New",Courier,monospace;">traceroute -n --mtu xxx.xxx.xxx.xxx</span><br />
<br />
берем минимальный и проставляем в настройках Network Manager или ручками:<br />
<span style="font-family: "Courier New",Courier,monospace;">sudo ifconfig eth0 mtu VALUE</span></div>droid develophttp://www.blogger.com/profile/08282691307280725595noreply@blogger.com124tag:blogger.com,1999:blog-5315017602464763002.post-59785290416584454402012-03-19T00:54:00.000-07:002012-03-19T00:54:15.159-07:00Поднимаем WiFi Access Point под Ubuntu 11.10<div dir="ltr" style="text-align: left;" trbidi="on">Очень подробный мануал вот здесь:<br />
<a href="http://exain.wordpress.com/2011/03/31/making-a-wifi-hotspot-access-point-using-linux-wifi-lan-cardusb-adapter/">http://exain.wordpress.com/2011/03/31/making-a-wifi-hotspot-access-point-using-linux-wifi-lan-cardusb-adapter/</a><br />
<br />
На моем буке Asus K73S все заработало практически без напильника<br />
Два маленьких дополнения:<br />
<b>dhcpd</b> под Ubuntu оказывается называется isc-dhcp-server, о как!<br />
Соответственно стартует он через<br />
<b>sudo service isc-dhcp-server start</b><br />
<br />
И конфиги его лежат не в /etc/dhcp3/ как указано в источнике, а в<br />
<b>/etc/dhcp/dhcpd.conf</b></div>droid develophttp://www.blogger.com/profile/08282691307280725595noreply@blogger.com34tag:blogger.com,1999:blog-5315017602464763002.post-59686017928628698522012-03-14T22:29:00.003-07:002012-03-14T22:40:25.329-07:00Custom screen resolution for android-x86 under Virtual Box<div dir="ltr" style="text-align: left;" trbidi="on">Занимаюсь сейчас проектом под планшеты с Андроидом 4.0. Эмулятор тормозит, несмотря на свежее железо. В основном видимо из-за большого экрана - при стандартном HVGA все летает. Решил вернуться обратно на android-x86 + Virtual Box. Скачал 8 гигов исходников, собрал за 3 часа - все работает. Одна беда - разрешение нужно нетривиальное: 1280х800. VESA такое не поддерживает, поэтому в загрузе kernel параметр vga=xxx не помогает. Решено было задействовать uvesafb:<br />
<br />
1. меняем строчку загрузки: kernel ... <strike>video=-16 vga=xxx</strike> video=uvesa UVESA_MODE=1280x800 (обязательно большими буквами!)<br />
2. из консоли запускаем: VBoxManage setextradata "Your VM name" "CustomVideoMode1" "1280x800x32"<br />
<br />
вуаля )))</div>droid develophttp://www.blogger.com/profile/08282691307280725595noreply@blogger.com16tag:blogger.com,1999:blog-5315017602464763002.post-59758250997173876422011-04-27T04:44:00.000-07:002011-04-27T04:44:14.256-07:00OpenGL ES Texture и GalaxyTab<div dir="ltr" style="text-align: left;" trbidi="on">Задача - нарисовать плоскость с натянутой текстурой. Нашел демку, которая прекрасно работает на эмуляторе:<br />
<a href="http://www.anddev.org/android-2d-3d-graphics-opengl-problems-f55/draw-a-bitmap-using-opengl-t14920.html">http://www.anddev.org/android-2d-3d-graphics-opengl-problems-f55/draw-a-bitmap-using-opengl-t14920.html</a><br />
<br />
И все бы ничего, но при запуске данного кода на девайсе Galaxy Tab вместо текстуры - пустой белый квадрат.<br />
<br />
Примерно час убил на гугление и эксперименты, и оказалось, что нужно добавить два обязательных условия:<br />
1. Размер текстуры должен быть кратным 2: 32х32, 64х64, 128х128 и не превышать 128 (видимо хардварное ограничение)<br />
2. Текстуры нужно хранить в drawable-nodpi<br />
<br />
В решении проблемы очень помогли комменты вот к этой ветке:<br />
<a href="http://blog.jayway.com/2010/12/30/opengl-es-tutorial-for-android-%E2%80%93-part-vi-textures/">http://blog.jayway.com/2010/12/30/opengl-es-tutorial-for-android-%E2%80%93-part-vi-textures/</a></div>droid develophttp://www.blogger.com/profile/08282691307280725595noreply@blogger.com4tag:blogger.com,1999:blog-5315017602464763002.post-1392308092230764612011-04-21T04:12:00.000-07:002011-04-21T04:12:49.149-07:00Отказываемся от RelativeLayout<div dir="ltr" style="text-align: left;" trbidi="on">Задача - реализовать вот такой макет:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-luM_uWD4J2c/TbAPQudlVCI/AAAAAAAAAAM/x9gj1uWR1SE/s1600/device.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="http://4.bp.blogspot.com/-luM_uWD4J2c/TbAPQudlVCI/AAAAAAAAAAM/x9gj1uWR1SE/s320/device.png" width="320" /></a></div><br />
Думаете потребуется <b>RelativeLayout</b>? А вот и нет! Все можно сделать с помощью одних только <b>LinearLayout</b>. Там есть замечательный атрибут <b>layout_weight</b>, который позволяет задавать вес элемента (не путать с layout_width!). Поскольку по-умолчанию веса всех элементов равны нулю, достаточно у ListView сделать layout_weight="1" и он сразу же займет все свободное место вверху, прижав строчку с кнопкой к низу экрана. Точно также - задав у строки ввода layout_weight="1" мы прижимаем кнопку "Add" к правому краю.<br />
<br />
Другие возможности - можно сделать ряд одинаковых кнопок, размер которых будет одинаков для всех разрешений экрана - достаточно установить у каждой тот самый layout_weight. Исключительно полезный атрибут - поэкспериментируйте!</div>droid develophttp://www.blogger.com/profile/08282691307280725595noreply@blogger.com7tag:blogger.com,1999:blog-5315017602464763002.post-21849062311102793352011-04-21T02:53:00.000-07:002011-04-21T02:58:02.857-07:00Устанавливаем ListView на конкретную позицию<div dir="ltr" style="text-align: left;" trbidi="on">Вот вроде простая задачка, ан-нет! На собеседованиях я это часто спрашиваю - мало кто отвечает. Странно ... Вот вроде по логике должно быть достаточно:<br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">list.setSelection(position);</span><span style="font-family: "Courier New",Courier,monospace;"></span><br />
<br />
<span style="font-family: inherit;">А вот не работает! Оказывается нужно так:</span><br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">list.requestFocusFromTouch();</span><br />
<span style="font-family: "Courier New",Courier,monospace;">list.setSelection(position);</span><br />
<div style="font-family: inherit;"><br />
</div><div style="font-family: inherit;">Кто-бы мог подумать! </div></div>droid develophttp://www.blogger.com/profile/08282691307280725595noreply@blogger.com23tag:blogger.com,1999:blog-5315017602464763002.post-2650545655203670812011-04-21T02:45:00.000-07:002011-04-21T02:47:01.854-07:00Начало<div dir="ltr" style="text-align: left;" trbidi="on">Давно было желание завести бложик, да все как-то времени не находил, а вот - приперло (<a href="http://tinyurl.com/633hr6c">http://tinyurl.com/633hr6c</a>)<br />
<br />
А писать я буду про Android. Давно уже девелоплю, много всяких решений накопилось - столько, что уже сам начал забывать некоторые. Так что буду складывать их сюда - пока для себя. А там, глядишь, и пригодится еще кому-нибудь</div>droid develophttp://www.blogger.com/profile/08282691307280725595noreply@blogger.com28