discover android ios windows mobile from http headers HTTP_USER_AGENT reliability? - android

Is this approach corect and not vulnerable to ambiguity?
I split whole content o HTTP_USER_AGENT into words, and check:
if there is `iPhone` -> iOS
if there is `Android` -> Android
if there is `Windows` -> Windows Mobile
else -> no mobile

First you forgot "iPod" as iOS
Second, this is your only way to detect the device but it is not secure at all.
Headers can be changed really easily, you can even find chrome or firefox plugins that let you customize your headers to whatever you want.
If it is only a detection for confort purposes : You have an iPhone let's show you a nice Apple image, then it's ok, the people changing their user_agent know what they are doing.
If it is a security or "it must be infaillible" scenario, then this does not work at all as it is spoofable very easily.
If you are working on a native app, you are better of sending the platform name using a GET or a POST variable and using HTTPS to avoid your variable being tampered with.

Related

How to run 'spacebrew' in "android mode" from processing?

I am making an andriod app using 'andriod for processing lib" of processing (ie. running android mode in processing 2.0.3 and lauching it on my device).
Spacebrew (http://docs.spacebrew.cc) is a easy to use web socket library for processing , also availabel as javascript.
if i run the spacebrew example codes in andriod mode, the app gets launched in my device but doesnt show up in my spacebrew admin. whereas if i run the same thing in my mac, it shows up correctly. guess the websocket communication is not happening while using "andriod for processing". But this is the easiest way to use web sockets. So can anyone help me figure out on how to make spacebrew work in processing (android mode)
this is for my college project. any suggestions on how to get this running please? thankyou in advance
Thanks for pointing me to Spacebrew, didn't know about that!
I've just tested it from Android Mode and it does work, but there is a tiny quirk you might be missing out: permissions!
Normally, if your app uses extra permissions, the application's manifest allows you to use these. In Processing, that's also possible via Android > Sketch Permissions and in the case of Spacebrew, INTERNET is the permission you need enabled, as you can see below:
I just a did a test myself and it seems to work just fine with the amazon hosted demo:
Note that the Spacebrew Processing library uses the java websocket library, but only sets up a WsClient client. You can if you want use this jar in an Android SDK eclipse project and have your Android app act as a websockets server as well, not just a client (just in case this will become handy to you at some point in the future)

access Android phone data from computer scripting env

I am planning to to manage my phone (Running Android) data (contacts, call logs, messages, reminders etc..) from my computer (it is running linux). Is there a way to access these data from within a scripting env like perl/python? I tried searching in web but couldn't find anything useful.
There are ways to do this easily. Look what I foung on google:
contacts : here is a guide on exporting yo
call logs : this app exports it as csv
sms : app for exporting those..
This way you can save all the files you need on your computer andd access them at will..
if you mean accessing internal android API from python/Perl for developing a python/perl based app - I dont know of any such bridge. But for VB you have Basic4Android which works pretty well, check it out.
Good luck
Just found this - https://code.google.com/p/python-for-android/ maybe this is what you need.

How is 'reader mode' in Firefox triggered?

I'm using Firefox Mobile on an Android device and I'm fond of the 'Reader mode' features. However, the feature is not always available (e.g. Bash Guide).
So I'm looking for information on the mechanism of this feature, because it's still unpredictable.
Does it look for some semantic, #ids/#class values or something else ?
Firefox on Android uses readability.js as the basis for its "Reader Mode" support. Here is a content guide for making pages that are easy to extract content:
http://www.readability.com/developers/guidelines
The original readability code used in Firefox comes from:
http://code.google.com/p/arc90labs-readability/
Note that not all pages can be converted into Reader Mode, in fact, that's not the intention. If you come across a page that you think should be handled by Reader Mode, please file an issue in the github issue tracker:
https://github.com/mozilla/readability/issues
The developer of this features just reply via Twitter :
#edouard_lopez No docs, sorry. It finds for the main content of the
page based on a number of things (tag name, classes, id, etc).

Build Chrome for Android

My original post was about one month ago. Looks like Google has really cleaned it up and made the basic features upstream. With the help of Nikolay's comment, I was able to build the contenttest shell and chromium test shell. However the chromium test shell looks exactly like the content shell. It basically has an address bar and back/forward button. That's it.
I am still trying to find my ways in this giant project. But my understanding is that Chromium should be a fully functional browser including the basic UIs such as menus, bookmarks, etc (just like Firefox). Chrome is Google's flavor with their own Google specific services. But Chromium should has the basic features as a fully functional browser. So is it the right understanding? If so, why Android port is not? Anybody knows that if there is the full UI code for Android in Chromium? If not, is it coming or it will be like this going forward? Any other open source project that can be used to add a basic full browser UI to chromium for Android?
There is no Chromium build for Android. As of right now the closest you are going to get is to build the ContentShell described in https://code.google.com/p/chromium/wiki/AndroidBuildInstructions - content shell gives you a lot of the browser that you need, however not all of it.

Spoofing Location

I've got an application in the browser that's customized to use Android's browser geolocation APIs. I'd like to find a way to fake the lat/lng that's sent to the browser so I can type in arbitrary coordinates.
In doing some research I came across DDMS - http://developer.android.com/guide/developing/tools/ddms.html - which seems to do what I want, but seems to require the IDE or an emulator. I don't want to use an emulator because I want to test on the device and I don't have the IDE set up for Android.
Does anyone know if there's a way to send mock location data to an Android device without loading up the IDE (or doing it through the emulator)?
I do not believe this is possible -- sorry!
Also the DDMS and IDE solutions are one and the same and only work with the emulator.
Just in case someone stumbles across this question like I did, here is some info about how to mock the LocationProvider on a physical device. Marking this as community wiki because I didn't come up with the original answer. Code is listed in diffract.me/2009/11/android-location-provider-mock (looks like domain is expired as of 9/29/2010, I used Google's cache of the page) & from stackoverflow.com/.../android-mock-location-on-device.

Categories

Resources