HTML, CSS, batch commands, and Javascript examples that I have used in my library work. Short entries, designed as quick reference.
By Len Davidson at CUA Law Library
Showing posts with label smartphone. Show all posts
Showing posts with label smartphone. Show all posts
11/08/2019
3/02/2018
4/07/2017
video chat software: Appear in
My library has started using Appear in for video chatting, it as apps for phones, and easy webpage interface: https://appear.in/
- No registration or downloads
Guests won’t have to register to join. Just send them the room link to join in the browser. - Group video conversations
You can have video conversations with up to 8 people at once. - Simple screensharing
Want to share your screen to present something? Of course you can!
3/19/2013
Directions to Library - Geolocation
This uses Google Maps API to detect location of mobile device, and then show map & directions to one fixed location, like a library branch.
First add this line:
Second add these functions:
Styles to make to control look and feel:
How to do the same thing with other mapping services:
Bing
First add this line:
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true"> </script>
Second add these functions:
<script>
(function () {
var directionsService = new google.maps.DirectionsService(),
directionsDisplay = new google.maps.DirectionsRenderer(),
createMap = function (start) {
var travel = {
origin : (start.coords)? new google.maps.LatLng(start.lat, start.lng) : start.address,
destination :"38.936165,-76.996363",
travelMode : google.maps.DirectionsTravelMode.DRIVING
// Exchanging DRIVING to WALKING above can prove quite amusing :-)
},
mapOptions = {
zoom: 10,
// Default view: lat & lng of center of map, CUA Law School
center : new google.maps.LatLng(38.936165,-76.996363),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map-image"), mapOptions);
directionsDisplay.setMap(map);
directionsDisplay.setPanel(document.getElementById("map-directions"));
directionsService.route(travel, function(result, status) {
if (status === google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(result);
}
});
};
// Check for geolocation support
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (position) {
// Success!
createMap({
coords : true,
lat : position.coords.latitude,
lng : position.coords.longitude
});
},
function () {
// Gelocation fallback: If can not get location
createMap({
coords : false,
address : "3600 John McCormack Rd., NE Washington DC 20064"
});
}
);
}
else {
// No geolocation fallback: Defaults CUA LAW
createMap({
coords : false,
address : "3600 John McCormack Rd., NE Washington DC 20064"
});
}
})();
</script>
<div id="map-container">
<div id="map-image"> </div>
<div id="map-directions"> </div>
</div>
Styles to make to control look and feel:
<p><style type="text/css">
#map-container {
overflow: hidden;
}
#map-image {
width: 500px;
height: 400px;
margin:auto;
}
#map-directions {
width: 500px;
margin:auto;
background:#FFF;
}
</style></p>
How to do the same thing with other mapping services:
Bing
3/07/2013
Android screen capture (HTC phone)
HTC EVO 5
Hold down power button and press home.
More general case:
6 Ways To Take Screenshots On Android
Take a Screenshot with Android 4.0 (Ice Cream Sandwich)
If you’re using Android 4.0 or later, this is easy. Just press and hold the Volume Down and Power buttons at the same time. You’ll see an animation on the screen, indicating that the screen photo was saved. Android will save the image to your Gallery. Launch the Gallery app and tap Screenshots to view and share your screenshot.
Android SDK
You can take a screenshot on any Android device using Google’s Android SDK. After you’ve set up the Android SDK, all you have to do is connect your Android phone or tablet to your computer with its USB cable and fire up the SDK.This isn’t the most user-friendly application to set up, but it’s easy to use once you’ve set it up. We’ve got a guide to setting up the SDK and taking screenshots.

AShot aka Android Screen Capture
AShot is a free, open-source way to take screen images of your Android device from your computer. It requires the Android SDK installed and properly configured. AShot offers a variety of advantages over the Android SDK screenshot feature, including near-real-time streaming of your Android’s screen to the Ashot application on your computer. You won’t have to keep clicking the Refresh button, as in the SDK. For more information, check out our AShot walkthrough.
Manufacturer Shortcuts
Some manufacturers build special screenshot shortcuts into their pre-Android 4.0 devices. For example, on many Samsung Android devices, including the Galaxy Note and Galaxy S II (pre-Ice Cream Sandwich versions), you can press the Home and Power buttons at the same time to take a screen snapshot – in practice, you’ll press and hold the Home button, then quickly press the Power button. On the Galaxy S, press and hold the Back button and the Power button, or try pressing the Back button and double-tapping the Home button.Different pre-Android 4.0 devices use a variety of different shortcuts – give it a Google and you might find that your device has a built-in screenshot shortcut you don’t know about.

Device-Specific Apps
These manufacturer-specific hooks into the OS allow some apps to provide an easy-to-use, on-device way to take screen image. For example, Samsung Galaxy S, Galaxy Tab, and Galaxy S II (pre-ICS) users can use Screen Capture Shortcut Free to capture a screenshot without rooting their phones.Another example of a device-specific app is AndroSS, which can take screen images on Android without root access on Tegra devices. If you’re not sure whether a device-specific app exists for your device, search the Google Play Store and see.

Root Apps
The reason you have to jump through the hoops above instead of simply installing a screenshot app is because of Android’s security model. Android doesn’t allow apps to view your device’s screen – this could be a security problem. For example, a malicious app could spy on your online banking sessions. There’s no permission apps can request to take snapshots of your screen.To give an app permission to view your screen, you’ll need to root your Android. After rooting your Android, you can install one of the many screen snapshot applications that require root from Google Play. There are many options to choose from, although many of them are paid apps. aScreenshot is a free app that worked for me. You can take a screenshot in a variety of ways, including shaking your device, tapping a notification, or setting a delay. Other apps have similar features.

AirDroid, an awesome free app we’ve covered in the directory, also supports taking a screen shot on rooted devices. You can capture those images wirelessly via your web browser. AirDroid can control many other aspects of your device from a browser, too.

10/22/2012
Detect mobile device via Javascript, switch to mobile page
Our CMS is looks poor on mobile drives, looked at javascript to switch to a different page on detecting mobile device:
<script type="text/javascript">
var mobile = (/android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|iphone|ipod|iris|kindle|lge|maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent.toLowerCase()));
if (mobile){ document.writeln("<h2>
<a href='http://your.server.com/m.asp?insert_room=1'>Tap here for MOBILE version...</a></h2>
");
}
</script>
var mobile = (/android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|iphone|ipod|iris|kindle|lge|maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent.toLowerCase()));
if (mobile){ document.writeln("<h2>
<a href='http://your.server.com/m.asp?insert_room=1'>Tap here for MOBILE version...</a></h2>
");
}
</script>
I replaced the document switch:
document.location = 'http://your.server.com/m/'
with just adding a link to a different page:
document.writeln("<h2>
<a href='http://your.server.com/m.asp?insert_room=1'>Tap here for MOBILE version...</a></h2>
2/11/2012
Smart Phone Emulators
All the online, browser based emulators that I looked at, never rendered web pages like a real mobile phone. So best choice was so set up a stand alone emulator:
Android
List of Emulators
----------------------------------
I tried both, and neither produced output like a regular iPhone. They may convince a webserver that they are an iPhone, but then they don’t render the HTML/CSS as an iPhone does.
For example, they ignore this tag
<meta name="viewport" content="initial-scale=0.5, maximum-scale=1.5" />
Below:
LEFT: Safari with user Agent set to iPhone.
Right: Android emulator (matches what I see on iPhone)
Android
Android Virtual Device - Easy to install, can select different versions, and set initial RAM. Saves bookmarks between sessions, can use keyboard to enter textWindows Phone 7
Be careful of requirements for graphics card. Does not save info between sessions, cant use keyboard, must use virtual keyboard.Apple
Have not tested yet, need to run this on Apple machine.
List of Emulators
----------------------------------
Michael Johnson (Shawnee Univ) suggested these online emulators:
Safari as an emulator: http://www.mydigitallife.info/how-to-emulate-iphone-change-user-agent-in-safari-and-firefox-web-browser/
I tried both, and neither produced output like a regular iPhone. They may convince a webserver that they are an iPhone, but then they don’t render the HTML/CSS as an iPhone does.
For example, they ignore this tag
<meta name="viewport" content="initial-scale=0.5, maximum-scale=1.5" />
Below:
LEFT: Safari with user Agent set to iPhone.
Right: Android emulator (matches what I see on iPhone)
Subscribe to:
Posts (Atom)