How is 'reader mode' in Firefox triggered? - android

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).

Related

CKEditor 4.4.7 does not show up on any mobile browsers

I am creating an internal CMS for work, and it is important that all pages be mobile-friendly. When you view a page with CKEditor 4.4.7 installed from a phone, the editor shows up as a normal textarea and none of the HTML or text within it is properly formatted.
I can request a desktop version using my phone's browser, and sometimes this will work. It seems to be pretty hit-or-miss across different phones. I don't believe it has anything to do with enabling JavaScript.
Sorry for the lack of technical details - has anyone had any experience with this before?
Thanks.
EDIT ---
Found it. I'm currently invoking the editor by creating a normal text area and then adding this javascript which replaces it given an ID:
<script type="text/javascript">
$( document ).ready( function() {
$( 'textarea#SomeIDHere' ).ckeditor();
} );
</script>
Well, after some extensive digging, I found that you can automatically call whatever browser it's loaded into "Compatible", even though it's not necessarily safe or true, simply by adding altering the code as such:
<script type="text/javascript">
CKEDITOR.env.isCompatible = true;
$( document ).ready( function() {
$( 'textarea#SomeIDHere' ).ckeditor();
} );
</script>
I edited this just in case anyone ever comes across the same issue. Not sure how to close the question though. I'm too new and dumb.
In general, CKEditor is compatible with iOS and Chrome on Android. If it does not show up in these environments, this is most often an issue with the environment detection mechanism being misled by the browser user agent string.
Up till version 4.4.7 (actually, 4.4.8, but this one hasn't been released yet) CKEditor is only loaded on whitelisted environments (as defined in the env.js file). The original purpose was to block CKEditor from appearing in environments where it's not supported. However, the browser detection mechanism is not perfect, especially on mobile devices where browser vendors tend to spoof user agent strings, causing issues that you described.
You can, however, enable CKEditor is unsupported environments (at your own risk) by changing the CKEDITOR.env.isCompatible flag to true, which causes CKEditor to load in all environments, including the unsupported ones. Note, however, that this has one drawback: it not only enables CKEditor in modern mobile devices, but also tries to load it in old Internet Explorer versions (6&7) where it no longer works (which may cause some level of user frustration). And thus, when using this solution, it is recommended to still blacklist old IEs, like this:
// Enable CKEditor in all environments except IE7 and below.
if ( !CKEDITOR.env.ie || CKEDITOR.env.version > 7 )
CKEDITOR.env.isCompatible = true;
You can read more about it in the Enabling CKEditor in Unsupported Environments article.
An important note: This mechanism is just about to change in CKEditor 4.5, the next major relase that is due very soon. Ticket #13316 changes CKEDITOR.env.isCompatible from a whiletlist to a blacklist which will hopefully help resolve issues like this one.
here solution for you just need to change or updated you ckeditor.js file to latest ckeditor.js file
here link of latest ckeditor.js
here screenshot

discover android ios windows mobile from http headers HTTP_USER_AGENT reliability?

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.

How to connect wii balance board with android

How to connect Wii balance board with android?
Is there are any useful Library in android and how to use it?
My goal now is to connect it together and can receive data from it.
I'm new with android and Bluetooth development
I found this answer useful: Is it possible for an android device to read information from the wii controller and nunchuck? (quoted below with thanks to #Ben Mordue)
Have a look at this open source project:
http://code.google.com/p/android-bluez-ime/
Update:
I first installed the APK file on Galaxy Nexus and it works. I have checked the code out of the repo, and it builds fine, and it relatively easy to understand.
It comes in 3 projects - to use Wiimote, you need to install all 3 projects. The one is just used as a flag to allow the service to try for a Wiimote (considering not all ROMs support that level of HID interaction).
I also found these resources on WiiBrew.org:
http://wiibrew.org/wiki/Wiimote
http://wiibrew.org/wiki/Wii_Balance_Board
I used the Wiimote link to understand the Bluez-IME code.
Update 2:
Last night I got the board to communicate with my Android phone correctly. I did this by starting with the Bluez-IME code linked above, and modifying it based on the wiibrew.org info.
The trick is that the Balance Board is like a wiimote with an Extension. So its like a Nunchuk or Classic Controller, but just with a different device ID to look for.
For my initial demo, I just searched for all code that uses a Nunchuk, and duplicated it for a Balance Board. Then to initialise the MODE to use channel 0x32, as per the wiibrew Balance Board page.
Update 3:
I just stumbled across this app on the store: FitScales
And the developer has shared his code on github: paulburton / fitscales

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