Pages

Showing posts with label google. Show all posts
Showing posts with label google. Show all posts

Thursday, May 19, 2016

KitKat for HTC One Google Edition is out Sense version coming soon!


Android "four point four" (aka KitKat) is what most HTC One users are still eagerly waiting for. The "senseless" version is already available to download via Over The Air (OTA) update on the HTC One Google Play Edition.

If you havent received the update yet, or you dont have a Google Play Edition variant of the HTC One, you can still have a taste of the fresh Google goody. Just navigate to my HTC One Google Play Edition thread on the xda-developers forum and download Android Revolution HD based on Android 4.4 KitKat for the HTC One.

What weve already learned so far is that youll probably need an S-OFF device in order to properly boot KitKat custom ROM. Its a weird issue we still investigate and we hope to come up with some more convenient solution soon!

Also some good news for HTC Sense fans - Android 4.4 with HTC Sense 5.5 on board will be available very soon! Dont be upset its still Sense 5.5 instead of Sense 6.0. New update will bring a lot of bugs fixes and all the goodies Android 4.4 comes with. Stay tuned!

Have any questions or comments? Feel free to share! Also, if you like this article, please use media sharing buttons (Twitter, G+, Facebook) below this post!
Read More..

Thursday, April 14, 2016

How to check if the phone is connected to the Internet

to check whether your phone is connected to the Internet, use the following code:
ConnectivityManager con=(ConnectivityManager)getSystemService(Activity.CONNECTIVITY_SERVICE);
boolean wifi=con.getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnectedOrConnecting();
boolean internet=con.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).isConnectedOrConnecting();

these lines check for internet connection whether it is through WiFi or Mobile Internet.

you need to add the following permission to the AndroidManifest.xml file
<uses-permission android_name="android.permission.ACCESS_NETWORK_STATE" />

Another method is what our freind Kevin mentioned in the comments, is to check if a certain website is reachable or not like this:
public static boolean isOnline() {
try {
InetAddress.getByName("google.ca").isReachable(3);
return true;
} catch (UnknownHostException e){
return false;
} catch (IOException e){
return false;
}
}

we check if a site is reachable within a certain timeout or not.
Read More..

Wednesday, April 13, 2016

Cameras in Phones what do we really need


An awful lot is being said about mobile phone cameras just lately; and we have HTC to thank for opening the conversation with the introduction of their HTC One which has half as many pixels at twice the size of anyone elses. Before we begin Im going to get some ground rules. I wont use marketing terms; so I will talk about how many pixels a camera sensor has, and what size they are. You wont hear me talking about mega- or ultra- anything. Next is that I will show my meaning with diagrams - Im a visual person and it helps me to explain. Please bear with me on this post; theres a lot to read but its worth it at the end.

A digital camera uses a lens to focus an image onto an oblong of special material which has a number of sensors on it; each sensor is called a pixel and usually contains three sub-pixels; a red, a blue (actually two blues but dont worry about that) and a green one. Each of these sends a signal to the camera depending how much light of that colour is falling onto it. Bigger pixels produce a bigger signal for the same amount of light than smaller ones. When signals are small, the amount of noise (erroneous signal levels produced simply by electrons moving around) is a bigger percentage of the whole signal because noise is a constant backdrop. When the signals are bigger therefore, its easier to pick out the signal, from the noise. More noise means that the signal produced by a smaller pixel is less accurate which means the final photo may not have exactly the same colour from each pixel receiving the same light.

Camera sensors line up their pixels in rows and columns - and the cameras rating is often quoted by counting them. For instance a 10MP camera contains ten million pixels (roughly). These are arranged in a rectangular grid with a side length ratio of 16:9 - so thats 4213 pixels across and 2370 pixels high. If you have a sensor which is 7mm across, each pixel is 7/4213=1.662 microns across (microns = thousandths of a millimetre).

In the real world, standard sensor sizes and pixel sizes exist; a 13 million pixel camera in a phone will have pixels about 1.1 microns across; this gives a sensor width of about 4.55mm (there are 4128 pixels across the image). In the HTC One, the best photos are 2688 pixels across, and the pixels are 2 microns across giving a sensor width of about 5.4mm.
Figure 1 - 4 million large pixels
Figure 1 - 4 million large pixels

Figure 2 - 8 million (smaller) pixels on same size sensor
Figure 2 - 8 million (smaller) pixels on same size sensor
Now we can start looking at construction. Take a look at Figure 1. This shows a camera with large pixels - the lens is focussing the image onto an area exactly the same size as the sensor. In Figure 2, we gave the camera more pixels (which really does give more detail in the image but at the expense of noise and grain - and also less sensitivity at low light levels). Of course; straight away you want more, BIGGER pixels. Figure 3 shows that if you make that happen, the image doesnt cover the whole sensor; the light falls on a little bit of it. So - in Figure 4 we move the sensor further away to ensure the image covers all the pixels.
Figure 3 - 8 million large pixels with no other changes
Figure 3 - 8 million large pixels with no other changes

Figure 4 - Sensor moved away, but the lens size is unchanged.
Figure 4 - Sensor moved away, but the lens size is unchanged.
However; the same amount of light, entering the lens, is now spread over a wider area: this dims the light hitting each individual pixel, which reduces the signal output and increases the noise. The only way to change this is to make the lens bigger - the aperture wider - so that more light gets in. This is shown finally in Figure 5.
Figure 5 - all required changes incorporated.
Figure 5 - all required changes incorporated.
So - how far back do we have to move the lens? Simple trig shows us the answer. Imagine the "field of view" of the lens is about 60° (not unreasonable): the light coming in from the left and right cross over in the centre of the lens and make a triangle with the sensor as the base... an equilateral triangle is formed with all angles at 60° and all sides the same length (lets call it 5.4mm to stick with the HTC Ones sensor size). So the lens must be 2.7mm away from the sensor. If we now make the sensor an 8MP one (3800x2140 pixels) that gives a width of 7.6mm - the lens still has a viewing angle of 60° so that means the sensor has to be 3.8mm away from the lens. Obviously I have used 60° as the lens viewing angle because it makes the angles, sines and side lengths easy to calculate - the numbers are probably quite different in real life but you get the idea: to get double the megapixels you have to move the sensor further from the lens, which means you need a bigger lens to gather the light needed to adequately illuminate it. Lenses very rapidly increase in price with size - a lens 4mm across instead of 2mm might cost three or four times as much. (BTW - the large circular opening on the back of the phone is NOT the lens; the lens is the tiny dark speck in the centre of it).

In practical terms for a smartphone? This means that, to get an 8 million pixel camera, with pixels 2 microns across, your phone would need to be about 16-18mm thick (at least at the cameras location); and the phone would cost upwards of US$1000 - possibly even more - JUST because of the lens.

This isnt something which can be corrected with better design, or better lenses; the only way to mitigate this increase in size and cost would be to make smaller pixels which had the properties of larger ones - and that my friends is the nirvana of a pixel scientist! The very best technology available is going into these phones - and with todays tech were stuck with these limitations. In another article Ill talk about why I believe 4MP at 2 microns across is enough.


This article is also to be found on its author personal blog.

Have any questions or comments? Feel free to share! Also, if you like this article, please use the media sharing buttons (Twitter, G+, Facebook) under this post!
Read More..

Monday, April 11, 2016

Lyft connects drivers and riders with Google Maps APIs




Editor’s note: Today’s guest blogger is Vishay Nihalani, Product Manager at the ride-sharing service Lyft. Read how Lyft uses Google Maps APIs to help riders save money and get to their destinations faster. Lyft is one of many customers sharing their story as part of our cross-country road trip, Code the Road.

We know a lot about road trips—people have taken tens of millions of rides with us from the steep hills of San Francisco to the city streets of Chicago. Ride-sharing today is an intensely competitive business. If you’re going to succeed, you’ve got to connect riders and drivers simply and conveniently and make the experience delightful from beginning to end. That’s why we chose Google Maps and the Google Maps APIs. We started using them with our internal operations tools, and when we saw how valuable and scalable they were, we worked with Google to launch their services in our customer-facing apps.
The Google Maps Android API creates our Android app’s main interface—it’s the map you see when users log in. Our users can drop pins on a map or enter their location manually to indicate pick-up and drop-off locations. Through reverse geocoding, the app will recognize locations and determine an address automatically based on where the pin is dropped. We also help people find their locations by using the Google Places Search API. People often think about the places they want to go by name—for example, they’ll enter “Cliff House” rather than the restaurant’s street address. The Google Places Search API allows a passenger to enter the name of a destination.
When customers use our app, they expect there’ll be a car waiting for them and they’ll get to their destination as quickly as possible. They need to know when they’ll be picked up and when they’ll get where they want to go. We make it easy for our riders to quickly see this information right in the app.
Lyft now has more than 100,000 drivers and delivers more than two million rides per month in 65 cities. We’ve seen more than 500% growth in rides and revenue since last year, thanks in large part to Google Maps. And we’re exploring ways to make Lyft even better by using maps to improve the ride options we offer—for example, by expanding our new Lyft Line option for riders going in the same direction.

Google has been a great partner and has really contributed to our success, so we’re pleased to participate in Code the Road as Google celebrates mapping innovation and fun on its trip across America. Kyle Madsen, Android Developer at Lyft, presented at the Chicago developer meetup on June 9th. It was a great crowd and an exciting event. We hope to see you on the road!
Read More..

Sunday, April 10, 2016

Retirement of certain Google search APIs

Posted by Vijay Subramani, Technical Program Manager, Google Cloud Platform

Back in 2011, we announced the deprecation of the following APIs: Google Patent Search API, Google News Search API, Google Blog Search API, Google Video Search API, Google Image Search API. We supported these APIs for a three year period (and beyond), but as all things come to an end, so has the deprecation window for these APIs.

We are now announcing the turndown of the above APIs. These APIs will cease operations on February 15, 2016.

You may wish to look at our Custom Search API as an alternative for these APIs.

Read More..

Saturday, April 9, 2016

Keep all of your work more secure with Google Drive



Since we launched Drive for Work 9 months ago, weve watched as more and more businesses moved to the cloud — and seen that they prioritize data security as much as we do. Security ranks at the top of the list of concerns that companies have about moving to the cloud, which is why we’ve put security front and center in our products from the beginning. And to keep your company’s data even more secure in Drive, we’re launching new sharing controls, alerts and audit events to Google Drive for Work and Google for Education over the next several weeks.

For Google Drive for Work customers:
Set sharing settings by department
Sometimes different file settings make sense. You might, for example, have a research department that needs to keep information confidential and a sales team that needs to share presentations with their clients. To help manage these different sharing needs, now when you make selections in Drive settings from the Admin console, you can turn off sharing outside the domain for one organizational unit, while still allowing others to work and share files with anyone they need to.

Create custom Drive alerts and track more events with Drive audit
To keep track of when specific actions are taken in Drive, you can set up custom Drive alerts. So if you want to know when a file containing the word “confidential” in the title is shared outside the company, now you’ll know. And there are more events coming to Drive audit, including download, print and preview.
For all Google Apps for Work customers:
Set up custom admin alerts to find out when things change
There are lots of moving parts to running a company, and now it’s easier for IT to find out about the things they care about with custom alerts — like when a new app is installed or a shared calendar is deleted — and get those right in their inbox.

Let people reset their own passwords
Recovering passwords isn’t the most pleasant thing we do in our lives. But now IT can let employees securely reset their own passwords, so they don’t lose valuable time being locked out of their account. If this doesn’t make sense for your organization, admins can simply turn this ability off.

Available for all to use:
Disable downloading, printing and copying of any file with IRM
With Information Rights Management (“IRM”) you can disable downloading, printing and copying from the advanced sharing menu – perfect for when the file you’re sharing is only meant for a few select people. This new option is available for any file stored in Google Drive, including documents, spreadsheets and presentations created in Google Docs.

Share quickly with anyone outside your organization
When it comes to sharing, like giving final inventory lists to your caterer or last minute logos to your design agency, you want to make sure people can see it right away — whether they use Drive or not. Now, you can share with any email address and they’ll be able to view the files you share —without having to sign-in to a Google account. Admins can disable this feature for certain departments that want to require sign-in before , while enabling it for others.

All the above are rolling out over the next month.

Stay tuned for more
We’re also working on the ability to establish trusted domains, so businesses and schools that have multiple Google Apps domains or want to work with trusted partners or customers, can select multiple Google Apps domains that are OK to share with from Drive and Classroom. And on expiring access, because occasionally you only want to share files for a temporary amount of time. With expiring access you can set a future date when access will be removed. Stay tuned, theres more to come from Drive and Drive for Work.
Read More..

Tuesday, April 5, 2016

Google for Education hits the road


(Cross-posted on the Google for Education Blog.)

Remember back in 2008 when the Google for Education team road-tripped across the US, visiting universities using Google Apps for Education? We hardly do, either, which is why we were itching to get back out on the road. This time in the UK. And we brought along a pop-up classroom instead of a bio-fuel bus.

In four weeks, we visited seven schools in England, Wales and Scotland that are doing inspiring and creative things with education technology. We wanted to hear more about how Google for Education tools are helping them to transform their approach to teaching and learning, and we wanted to provide an opportunity for other educators nearby to hear and learn from them, too.
Our pop-up classroom at Wigan UTC


And we werent disappointed. We heard from Cramlington Learning Village in Newcastle, where Physical Education students have become more engaged by doing their own real-time personalized fitness tracking with Google Sheets on their Chromebooks. That’s what we call healthy competition!

Students of GSCE Physics were getting a last-minute helping hand with their study thanks to revision videos created by the science department hosted on Youtube at The Streetly Academy in Birmingham. “What’s great about them is that we’re used to their style of teaching and their voices – and our teachers know how we learn best,” says Jack Webb, a student of The Streetly Academy.

City Heights E-Act Academy in London also gave media teachers some great ideas, by showing us how their students utilized Google Drive when creating their BBC School Report and giving us a demonstration of their HTML writing abilities.
Students at City Heights E-Act Academy showed off their HTML writing capabilities






We also loved how inquisitive students at the Horsforth Campus of Leeds City College used Google Draw to document and track changes to nearby wetland areas over time, based on their hypothesis about how a nearby motorway is affecting the surrounding ecosystem.
Students at Preston Lodge High School working collaboratively in our pop-up classroom


We toured the world’s first controlled-environment agricultural facility using a Vertical High Density Growing system in an educational institution at Wigan UTC. There, budding food technicians can get hands-on with technology that can help to combat current and future food production issues, working together to track production levels collaboratively with Google Sheets.

In East Lothian, the pipe band at Preston Lodge High School treated us to a roof-lifting performance to start the morning!
The Preston Lodge High School Pipe Band warming up






We heard lots of teacher tips along the way, but our favourite was from Assistant Headteacher David Beesley, who uses boomerang for Gmail to set his emails to send at times he knows his staff are at their desks.
Asst. Headteacher David Beesley sharing his favourite Gmail tips










Students at St. Julians showed us their favourite apps on Google Play
One day Google for Education might pop up—or roll into—a town near you, but in the meantime you can check out a video of our pop-up classroom being built, captured by the impressive media students at St. Julian’s in Newport, Wales.
Read More..

Saturday, April 2, 2016

Official Google Blog Supercharging Android Google to Acquire Motorola Mobility

Official Google Blog: Supercharging Android: Google to Acquire Motorola Mobility
Read More..

Thursday, March 24, 2016

Doctor on Demand Improves Patient Care using Google Maps APIs



Editors note: Since the launch of Google Maps ten years ago, maps have come a long way. To celebrate a decade of map innovation, we’re highlighting unique maps built by our developer community. Read how guest bloggers, Ed Bindl and Jacinda Shelly, Software Engineers for Doctor on Demand, use the Google Maps APIs to bring unique mapping experiences to users.

Maps can do much more for an online business than help people get from point A to point B. You might not think that a website for making video appointments with medical professionals would benefit from mapping — but at Doctor on Demand, maps connect our patients to physicians faster and allow physicians to prescribe medications at the right pharmacies. Google Maps make our user experience much more satisfying, which means patients will use our service again.
We use the Google Maps APIs, including the Geolocation and Javascript APIs, to show patients a map of nearby pharmacies before they start a video call with a medical professional. For our users, maps make it easy and convenient to connect with physicians and pick up prescriptions at the pharmacy. But maps can be helpful for other businesses in other ways. And now that we see the great value of incorporating reliable map functionality into our app, wed love to share how you can do the same:

  • Choose a familiar interface. Use a map that’s easy for people to navigate – if it’s hard to understand and requires extensive instructions, they won’t use it. We picked Google Maps because our patients know them well.

  • Configure maps for many platforms. If your users find maps helpful on your desktop website, they’ll want to use maps from any browser or device. We’ve made sure our maps work just as well on iOS and Android devices as they do on a desktop computer.

  • Maintain accuracy. In our case, we have to update the geolocation information for about 65,000 pharmacies across the country every evening. We use the Google Maps Geocoding API, which minimizes the time it takes to keep our map accurate. We keep a database of all pharmacies from Surescripts, a healthcare network, and each night we get an update to that database that adds, removes, and updates pharmacies and their locations. We use the Google Maps Javascript API to place the pharmacies on our map when a patient is asked to select a pharmacy.

  • Meet compliance standards. In order to comply with medical regulations, Doctor On Demand must connect patients with physicians licensed in their state. We use the Google Maps Reverse Geocoding API to accurately determine the state a patient is located in before connecting them with a physician.

  • Help users save time and make better choices. Before we built our pharmacy map, patients had to tell doctors which pharmacy they wanted to use. Then doctors emailed us the details. However, our support team had to follow up with doctors and patients to make sure we had the right pharmacy, since patients might say something like, “the drugstore down the street from my house.” Today, there’s no doubt about which pharmacy is the right one, since patients can clearly see their local outlets on the map.

Our pharmacy map inspires us to think about new ways to use maps in the future – like plotting the movement of cold and flu outbreaks and sharing this data with patients and doctors. We see a direct connection between maps and improving patient care. In the greater scheme, Google Maps improve the health of our patients, and, the health of our business.


Read More..

Monday, March 21, 2016

Polygon Group uses Google Apps to drive disaster response



Editors note: Today’s guest blogger is Mats Randleff, IT Director for Stockholm, Sweden-based Polygon Group, a global provider of property damage restoration, temporary humidity control and property performance services. 

When disaster strikes, Polygon Group is often the first call companies make to help restore their facilities and critical documents. We also provide services like humidity control to prevent property damage, and consult on business continuity and disaster recovery plans. Nearly two-thirds of our 2,800-employees are mobile, so we can be on the spot for our customers whenever we’re needed.
Every minute counts when companies are trying to get back to business after a fire or flood, so our field technicians need reliable communication tools. We used various email systems across our 300 offices, but they needed rigorous IT support to stay up and running. We looked to the cloud for a single system our entire workforce could use and considered Microsoft 365 and IBM SmartCloud (since we’d been using Lotus Notes), but Google Apps stood out as a single, secure system with all the functionality we needed.

We believed our employees would quickly embrace Google tools, since Android was already our most widely used platform for mobile devices. When we tested Google Apps with 50 managers throughout Polygon and saw a 95% satisfaction rate, we wasted no time rolling out Apps to more than 1,900 users worldwide. We worked with Avalon Solutions, a Google Apps Premier Partner in the Nordics, who performed the successful migration and roll-out to our global team.

Since moving to Apps in spring 2013, we’ve achieved significant cost savings. We’ve reduced travel expenses because our workers use video-conferencing on Hangouts to meet rather than coordinate costly and time-consuming in-person meetings. IT support costs are down, too. In fact, compared to our previous Lotus Notes environment, our cost per user is about 50% less – which translates to about $480,000 in annual savings.

Global cooperation has also improved, particularly because group managers have embraced Google Sites as a strategic tool. They’ve created sites for business systems used to report on each group’s operational performance. Managers can monitor financial metrics, key performance indicators, and other information in a single environment that’s easy to use and share. We plan to create sites for our country management teams to track business performance for each region.

Google Apps opens up new ways of working at all levels within Polygon, from managers to field technicians. What began as a search for a new email system has evolved into a complete overhaul of our communications. Today, thousands of Polygon employees across more than a dozen countries communicate and collaborate with ease using Google Apps. The greatest benefit for us is that we now can provide a faster, more effective response to businesses in the challenging and courageous position of overcoming natural disaster.
Read More..

Monday, March 14, 2016

Madison Fifth builds interactive mall experiences for kiosks and mobile using Google Maps APIs


Editors note: Today we hear from Chris Shirer, President and Chief Strategist of the digital brand management agency Madison + Fifth. Read how Madison + Fifth and Google Maps for Work Partner Woolpert used Google Maps APIs to build an interactive kiosk and mobile apps for the 60-acre Liberty Center mixed-use shopping center.

When the Liberty Center retail center outside of Cincinnati approached us to provide accessible, intuitive wayfinding for visitors, we saw the opportunity to create something unique — not just a standard kiosk and printed directory. The center includes shopping, restaurants, a hotel, offices and luxury housing, so we wanted to make sure visitors could get around quickly, especially during busy times like this past holiday shopping season. We decided to build a solution that would work on touchscreen kiosks and mobile devices to detect visitors’ locations and give them interactive walking directions in real time.

We chose Google Maps and Google Maps APIs to do it because Google offers a familiar interface for our customers, lets us layer custom information on top of maps and provides a platform that will allow us to add new features, like delivering relevant, location-based ads. We worked closely with Google Maps for Work Partner Woolpert to build the solution. Woolpert not only helped us with licensing information, but also did the programming based on our design and requirements.

Because we wanted the directory to work with both touchscreen kiosks and iOS and Android devices, we built a Web app using the Google Maps JavaScript API. The app scales automatically up to the large size of the kiosk and down to smartphones’ small screen sizes. With a Web app, we don’t have to build and maintain apps on multiple devices, and visitors with smartphones don’t have to download anything to use the service.
We started building the app before the Liberty Center was finished and opened to the public, which meant that Google didn’t yet have mapping information for the center’s streets and stores. We solved this by building a layer with the required information on top of the map. In addition, we had no routing information, so we built an algorithm to provide directions using open source Google Optimization Tools.

Liberty Center opened its doors on October 22, 2015, and thanks to Google Maps, we’re now delivering an engaging, interactive experience for visitors. People who walk up to the kiosks or use the Web app on their smartphones get customized walking directions based on their current location, and can zoom in and out around the property to explore shops and other destinations. Liberty Center shoppers can spend less time getting from place to place and more time in stores and enjoying time together in restaurants.
Read More..

Friday, February 26, 2016

Custom InfoWindow for Google Maps Android API v2


To create Custom InfoWindow for Google Maps Android API v2:

- Make your Activity implements GoogleMap.InfoWindowAdapter.

- Override getInfoWindow(Marker marker) and getInfoContents(Marker marker).

The API will first call getInfoWindow(Marker) and if null is returned, it will then call getInfoContents(Marker). If this also returns null, then the default info window will be used.

The first of these (getInfoWindow()) allows you to provide a view that will be used for the entire info window. The second of these (getInfoContents()) allows you to just customize the contents of the window but still keep the default info window frame and background.

- setInfoWindowAdapter(this).


Modify MapsActivity.java from last example "Make GoogleMaps marker draggabe and detect moving marker".
package com.blogspot.android_er.androidstudiomapapp;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.InputType;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.common.GoogleApiAvailability;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;

public class MapsActivity extends AppCompatActivity implements OnMapReadyCallback,
GoogleMap.OnMapClickListener, GoogleMap.OnMapLongClickListener,
GoogleMap.OnMarkerDragListener, GoogleMap.InfoWindowAdapter {

private GoogleMap mMap;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);

}

/**
* Manipulates the map once available.
* This callback is triggered when the map is ready to be used.
* This is where we can add markers or lines, add listeners or move the camera. In this case,
* we just add a marker near Sydney, Australia.
* If Google Play services is not installed on the device, the user will be prompted to install
* it inside the SupportMapFragment. This method will only be triggered once the user has
* installed Google Play services and returned to the app.
*/
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
mMap.setOnMapClickListener(this);
mMap.setOnMapLongClickListener(this);
mMap.setOnMarkerDragListener(this);
mMap.setInfoWindowAdapter(this);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return super.onCreateOptionsMenu(menu);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_addmarkers:
addMarker();
return true;
case R.id.maptypeHYBRID:
if(mMap != null){
mMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
return true;
}
case R.id.maptypeNONE:
if(mMap != null){
mMap.setMapType(GoogleMap.MAP_TYPE_NONE);
return true;
}
case R.id.maptypeNORMAL:
if(mMap != null){
mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
return true;
}
case R.id.maptypeSATELLITE:
if(mMap != null){
mMap.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
return true;
}
case R.id.maptypeTERRAIN:
if(mMap != null){
mMap.setMapType(GoogleMap.MAP_TYPE_TERRAIN);
return true;
}
case R.id.menu_legalnotices:
String LicenseInfo = GoogleApiAvailability
.getInstance()
.getOpenSourceSoftwareLicenseInfo(MapsActivity.this);
AlertDialog.Builder LicenseDialog =
new AlertDialog.Builder(MapsActivity.this);
LicenseDialog.setTitle("Legal Notices");
LicenseDialog.setMessage(LicenseInfo);
LicenseDialog.show();
return true;
case R.id.menu_about:
AlertDialog.Builder aboutDialogBuilder =
new AlertDialog.Builder(MapsActivity.this);
aboutDialogBuilder.setTitle("About Me")
.setMessage("http://android-er.blogspot.com");

aboutDialogBuilder.setPositiveButton("visit",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String url = "http://android-er.blogspot.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});

aboutDialogBuilder.setNegativeButton("Dismiss",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});

AlertDialog aboutDialog = aboutDialogBuilder.create();
aboutDialog.show();

return true;
}
return super.onOptionsItemSelected(item);
}

private void addMarker(){
if(mMap != null){

//create custom LinearLayout programmatically
LinearLayout layout = new LinearLayout(MapsActivity.this);
layout.setLayoutParams(new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT));
layout.setOrientation(LinearLayout.VERTICAL);

final EditText titleField = new EditText(MapsActivity.this);
titleField.setHint("Title");

final EditText latField = new EditText(MapsActivity.this);
latField.setHint("Latitude");
latField.setInputType(InputType.TYPE_CLASS_NUMBER
| InputType.TYPE_NUMBER_FLAG_DECIMAL
| InputType.TYPE_NUMBER_FLAG_SIGNED);

final EditText lonField = new EditText(MapsActivity.this);
lonField.setHint("Longitude");
lonField.setInputType(InputType.TYPE_CLASS_NUMBER
| InputType.TYPE_NUMBER_FLAG_DECIMAL
| InputType.TYPE_NUMBER_FLAG_SIGNED);

layout.addView(titleField);
layout.addView(latField);
layout.addView(lonField);

AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Add Marker");
builder.setView(layout);
AlertDialog alertDialog = builder.create();

builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
boolean parsable = true;
Double lat = null, lon = null;

String strLat = latField.getText().toString();
String strLon = lonField.getText().toString();
String strTitle = titleField.getText().toString();

try{
lat = Double.parseDouble(strLat);
}catch (NumberFormatException ex){
parsable = false;
Toast.makeText(MapsActivity.this,
"Latitude does not contain a parsable double",
Toast.LENGTH_LONG).show();
}

try{
lon = Double.parseDouble(strLon);
}catch (NumberFormatException ex){
parsable = false;
Toast.makeText(MapsActivity.this,
"Longitude does not contain a parsable double",
Toast.LENGTH_LONG).show();
}

if(parsable){

LatLng targetLatLng = new LatLng(lat, lon);
MarkerOptions markerOptions =
new MarkerOptions().position(targetLatLng).title(strTitle);

markerOptions.draggable(true);

mMap.addMarker(markerOptions);
mMap.moveCamera(CameraUpdateFactory.newLatLng(targetLatLng));

}
}
});
builder.setNegativeButton("Cancel", null);

builder.show();
}else{
Toast.makeText(MapsActivity.this, "Map not ready", Toast.LENGTH_LONG).show();
}
}

@Override
public void onMapClick(LatLng latLng) {
Toast.makeText(MapsActivity.this,
"onMapClick: " + latLng.latitude + " : " + latLng.longitude,
Toast.LENGTH_LONG).show();
}

@Override
public void onMapLongClick(LatLng latLng) {
Toast.makeText(MapsActivity.this,
"onMapLongClick: " + latLng.latitude + " : " + latLng.longitude,
Toast.LENGTH_LONG).show();

//Add marker on LongClick position
MarkerOptions markerOptions =
new MarkerOptions().position(latLng).title(latLng.toString());
markerOptions.draggable(true);

mMap.addMarker(markerOptions);
}


@Override
public void onMarkerDragStart(Marker marker) {
marker.setTitle(marker.getPosition().toString());
marker.showInfoWindow();
marker.setAlpha(0.5f);
}

@Override
public void onMarkerDrag(Marker marker) {
marker.setTitle(marker.getPosition().toString());
marker.showInfoWindow();
marker.setAlpha(0.5f);
}

@Override
public void onMarkerDragEnd(Marker marker) {
marker.setTitle(marker.getPosition().toString());
marker.showInfoWindow();
marker.setAlpha(1.0f);
}

@Override
public View getInfoWindow(Marker marker) {
return null;
//return prepareInfoView(marker);
}


@Override
public View getInfoContents(Marker marker) {
//return null;
return prepareInfoView(marker);

}


private View prepareInfoView(Marker marker){
//prepare InfoView programmatically
LinearLayout infoView = new LinearLayout(MapsActivity.this);
LinearLayout.LayoutParams infoViewParams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
infoView.setOrientation(LinearLayout.HORIZONTAL);
infoView.setLayoutParams(infoViewParams);

ImageView infoImageView = new ImageView(MapsActivity.this);
//Drawable drawable = getResources().getDrawable(R.mipmap.ic_launcher);
Drawable drawable = getResources().getDrawable(android.R.drawable.ic_dialog_map);
infoImageView.setImageDrawable(drawable);
infoView.addView(infoImageView);

LinearLayout subInfoView = new LinearLayout(MapsActivity.this);
LinearLayout.LayoutParams subInfoViewParams = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
subInfoView.setOrientation(LinearLayout.VERTICAL);
subInfoView.setLayoutParams(subInfoViewParams);

TextView subInfoLat = new TextView(MapsActivity.this);
subInfoLat.setText("Lat: " + marker.getPosition().latitude);
TextView subInfoLnt = new TextView(MapsActivity.this);
subInfoLnt.setText("Lnt: " + marker.getPosition().longitude);
subInfoView.addView(subInfoLat);
subInfoView.addView(subInfoLnt);
infoView.addView(subInfoView);

return infoView;
}

}


Reference: https://developers.google.com/maps/documentation/android-api/infowindows

Next:
- Detect user click on InfoWindow, by implementing GoogleMap.OnInfoWindowClickListener()


~ Step-by-step of Android Google Maps Activity using Google Maps Android API v2, on Android Studio

Read More..

Wednesday, February 24, 2016

Surfacing content from iOS apps in Google Search

Posted by Eli Wald, Product Manager

We’ve been helping users discover relevant content from Android apps in Google search results for a while now. Starting today, we’re bringing App Indexing to iOS apps as well. This means users on both Android and iOS will be able to open mobile app content straight from Google Search.

Indexed links from an initial group of apps we’ve been working with will begin appearing on iOS in search results both in the Google App and Chrome for signed-in users globally in the coming weeks:

How to get your iOS app indexed

While App Indexing for iOS is launching with a small group of test partners initially, we’re working to make this technology available to more app developers as soon as possible. In the meantime, here are the steps to get a head start on App Indexing for iOS:

  1. Add deep linking support to your iOS app.
  2. Make sure it’s possible to return to Search results with one click.
  3. Provide deep link annotations on your site.
  4. Let us know you’re interested. Keep in mind that expressing interest does not automatically guarantee getting app deep links in iOS search results.

If you happen to be attending Google I/O this week, stop by our talk titled “Get your app in the Google index” to learn more about App Indexing. You’ll also find detailed documentation on App Indexing for iOS at g.co/AppIndexing. If you’ve got more questions, drop by our Webmaster help forum.

Read More..

Friday, February 19, 2016

Hilton helps guests book the perfect room with Google Maps APIs

Posted by Virginia Suliman, Vice President of Digital Design and Development, Hilton Worldwide

(Cross-posted on the Google Geo Developers Blog.)

Editor’s note: Today’s guest blogger is Virginia Suliman, Vice President of Digital Design and Development, Hilton Worldwide. Read how Hilton is experimenting with Google APIs to take the guess work out of the hotel booking and room selection process. Hilton is just one of many customers sharing their story as part of our cross-country road trip, Code the Road.

No one likes surprises when they reserve hotel rooms, so it’s crucial for Hilton that people see exactly what they’ll be getting before they arrive. Currently, Hilton’s HHonors guests can use the HHonors website and app as a one-stop tool to control their on-property experience – from finding the best hotels in the right neighborhoods and booking the most suitable one, to soon, using the app as a room key.
couple_sitting.jpg

With a spirit of constant innovation, we’re always looking for new ways to enhance the guest experience. One way we’re doing so is by experimenting with the Google Maps APIs through proof of concept iPhone app functionality we built to enhance the room selection process during digital check-in. The concept tests a the Street View panoramas, part of the Google Maps SDK for iOS, letting users see on the app the exact view they’ll experience when they get to their hotel room. For example, they could virtually look out their window on the app and select the room that overlooks a park or a quiet street corner.
Businesswoman2.jpg

People care not just about the hotel they stay in, but also about the neighborhood, including what kinds of food, entertainment and amenities are nearby. So in our concept, we also tested a controlled list of businesses and points of interest from the Google Maps Places API for IOS to highlight nearby destinations via the HHonors app, like Lincoln Center in New York City, a great fish restaurant in Boston, or the Centennial Olympic Park in Atlanta.

The full potential of Google APIs sets in when you combine them. If successful, the Maps and Street View panorama concepts could one day fully integrate into our HHonors app or global web portal, which already uses Google Maps Business View to offer panoramic virtual tours of our properties to guests.

We believe that happy travelers are repeat customers who become loyalists. If you feel connected to the experience you’ve had with us, you’re more likely to return and to tell others about it. Through technology, we’re hoping to make it easier for people to find the perfect room, have an unforgettable stay and come back for another adventure.

We were delighted to participate in the Code the Road trip. We hosted the Code the Road bus at our Hilton Chicago property on June 10 and at Hilton Headquarters in McLean, Virginia on June 22. You can also see the Hilton HHonors app window-view proof of concept demo on the bus.
Read More..

Thursday, February 18, 2016

The Google Fit Developer Challenge winners

Posted by Angana Ghosh, Product Manager, Google Fit

Last year, we teamed up with adidas, Polar, and Withings to invite developers to create amazing fitness apps that integrated the new Google Fit platform. The community of Google Fit developers has flourished since then and to help get them inspired, we even suggested a few ideas for new, fun, innovative fitness apps. Today, we’re announcing the twelve grand prize winners, whose apps will be promoted on Google Play.

  • 7MinGym: All you need is this app, a chair, and a wall to start benefiting from 7 minute workouts at home. You can play music from your favorite music app and cast your workout to Chromecast or Android TV.
  • Aqualert: This app reminds you to stay hydrated throughout the day and lets you track your water intake.
  • Cinch Weight Loss and Fitness: Cinch helps you with detailed information your steps taken and calories burned. The app also supports heart-rate tracking with compatible Android Wear devices.
  • FitHub: FitHub lets you track your fitness activity from multiple accounts, including Google Fit, and multiple wearable devices, including Android Wear. You can also add your friends to compare your progress!
  • FitSquad: FitSquad turns fitness into a competition. Join your friends in a squad to compare progress, track achievements, and cheer each other on.
  • Instant - Quantified Self: Instant is a lifestyle app that helps you track not only your physical activity but your digital activity too and tells you how much you’re using your phone and apps.other activity. You can also set usage limits and reminders.
  • Jump Rope Wear Counter: This simple app lets you count your jump rope skips with an Android Wear device.
  • Move it!: This app packs one neat feature – it reminds you to get up and move about if you haven’t been active in the last hour.
  • Openrider - GPS Cycling Riding: Track and map your cycle routes with Openrider.
  • Running Buddies: In this run tracking app, runners can choose to share their runs and stats with those around them so that they can find other runners similar to themselves to go running with.
  • Strength: Strength is a workout tracking app that also lets you choose from a number of routines, so you can get to your workout quickly and track it without manual data entry. Schedules and rest timers come included.
  • Walkholic: Walkholic is another way to see your Google Fit walking, cycling, and running data. You can also turn on notifications if you don’t meet your own preset goals.

We saw a wide range of apps that integrated Google Fit, and both the grand prize winners and the runner ups will be receiving some great devices from our challenge partners to help with their ongoing fitness app development: the X_CELL and SPEED_CELL from adidas, a new Android Wear device, a Loop activity tracker with a H7 heart rate sensor from Polar, and a Smart Body Analyzer from Withings.

We’re thrilled these developers chose to integrate the Google Fit platform into their apps, giving users one place to keep all their fitness activities. With the user’s permission, any developer can store or read the user’s data from Google Fit and use it to build powerful and useful fitness experiences. Find out more about integrating Google Fit into your app.

Read More..

Tuesday, February 16, 2016

Enhanced add ons experience for Google Docs admins and developers


A year ago, we partnered with loads of great developers to showcase their add-ons for Google Docs. Add-ons have opened up a world of extra features for our users, from a student needing a powerful tool for diagrams to a project manager looking for a handy way to keep their team on track.

Today we’re releasing a couple of updates to help developers share their add-ons with an even wider audience and give Google Apps IT admins more consistent control over which add-ons are used in their organizations.

Developers can now choose to make their add-ons for Docs, Sheets and Forms available for installation across entire domains, which automatically creates a Google Apps Marketplace listing thats easy for customers to find. It also means that admins can install these handy add-ons for their whole organization using just a couple of clicks.


And speaking of admins, we want to make sure they have the control they need when it comes to deciding which add-ons are best suited for their organizations and teams. For example, in particular cases — like in education — it might not be desirable to let all end-users install their own add-ons. With this update, admins will continue to have a “disable add-ons” option for their users, but they can also whitelist add-ons via the Google Apps Marketplace for their entire domain or a specific team.

With these updates, customers can now get all the add-ons they want with all the control they need. Learn more about managing Google add-ons for your organization.
Read More..

Monday, February 8, 2016

Android Developers Blog Preview of Google TV Add on for the Android SDK

Android Developers Blog: Preview of Google TV Add-on for the Android SDK
Read More..

Sunday, March 16, 2014

Google Search results optimized for feature phones in 38 languages

One of our top goals on the mobile search team is to bring you the comprehensiveness of Googles web search while optimizing the search experience for your mobile device and in your language. Here is an update on our progress.

After launching new optimized search results pages last December for iPhone and Android-powered devices in the US, our team has been working hard to bring universal search results to more devices in more countries. In March, we expanded the availability of the new iPhone and Android format to over 20 countries. Since then, weve also launched the new experience for feature phones in the US and in Japan. Today, were happy to announce that the new format is available on all device models in over 60 countries and 38 languages.

Whether you have a smartphone or a feature phone, if you have mobile internet access you can get the new mobile-optimized Google Search results pages on your phone just about anywhere in the world. Just go to Google.com in your browser and do a search.

The new format provides improved support for the universal search results you are familiar with on your computer.
  • When available, News, Images, Blog, Video and Product Search results are blended right into your result page.
  • Many of your favorite Google Search features now appear in the first result to provide direct answers to your searches.
  • We continue to optimize specific results for mobile, so local listings for restaurants in London, for example, provide easy-to-select phone number links.
As always, we appreciate your feedback so leave us comments below or stop by our Forum to let us know what you think.

Read More..

Tuesday, March 11, 2014

Introducing Google Brain Search for mobile

Ever had a word on the tip of your tongue but just couldnt remember it? Or perhaps blanked on a persons name in a socially awkward situation? Or even suffered memory deterioration due to ordinary aging or questionable life choices? If so, Brain Search for mobile may be for you. Using our new CADIE technology, we can now index the content of your brain to make it searchable, thus bringing you aided retrieval of memories. Check out this video to see how it works:



Your phone already has an antenna, which can pick up wireless signals. CADIE technology modifies the input wavelengths so it can read brain waves. Go to the Brain Search App (here on a computer or here on a phone.) If you bring your phone to your forehead, your phone can index your brain, making it searchable. 

Since your phone is now modified to read brainwaves, you dont even have to type your search. Put your phone to your forehead and think your query, then click on "Search me". This is helpful in situations where you dont want onlookers to know what youre searching for, so you can feel comfortable asking personal things such as "What did I eat thats making me so gassy?" or "Did I ever go out with that girl? She looks vaguely familiar." And, since CADIEs artificial neural networks run faster than those of a human being, it is faster for her to search through your thoughts and memories than for you to do it yourself.

Brain Search is available for the US, UK, France, Germany, and Italy, and on a number of different devices.
  • On Android and iPhone devices, Brain Search runs in the browser, taking advantage of HTML5 and Gears technologies.
  • On Windows Mobile devices, make sure you download and install the latest version of Google Mobile App. Click the Panda icon (CADIEs choice, dont ask us) to get to Brain Search.  
  • On Blackberry devices (US and UK only), make sure you download and install the latest version of Google Mobile App. Type "Brain Search" in the search box. Youll get a link to Brain Search in the search suggestions below. 
To get started on any of these, go to google.com on your mobile device, and click the Brain Search link.

Dont forget. Brain Search.


Posted by Effie Seiberg, CADIE team
Read More..

Monday, March 10, 2014

Happy Holidays from the Google Mobile Team!

We hope you have a safe and happy (and mobile!) holiday season. To wrap things up, here are some final holiday Mobile Tricks. 

Ted Smolsen shows how he does last-minute shopping using Google Docs and Google Maps for mobile...

George shows how he keeps in touch with far-off relatives with a cameraphone, Picasa Webalbums, and a WiFi-enabled picture frame

and after your holiday meal, try ChangChangYalls Full-O-lator to understand what your relatives are saying.


From the Google Mobile team, search for recipes on your phone, use mobile YouTube to keep antsy kids at the dinner table, and remember to search for local times to wish your far-off friends a happy new year. 

Read More..