Pages

Showing posts with label maps. Show all posts
Showing posts with label maps. Show all posts

Saturday, February 4, 2017

Sun Surveyor brings augmented reality to photographers using Google Maps APIs



(Cross-posted on the Geo Developers Blog.)

Editors note: Today’s guest blogger is Adam Ratana, developer of Sun Surveyor. Read how Sun Surveyor is using Google Maps APIs to help photographers capture the perfect photo.

I’m a photography enthusiast, and I’m always looking for ways to improve my work. That’s what led me to develop Sun Surveyor, an iOS and Android app that uses Google Maps APIs to visualize the location of the sun and the moon anywhere in the world. The app makes it easy to figure out when the natural lighting will be just right — and get the ideal shot.

Sun Surveyor uses augmented reality to overlay the paths of the sun and moon on a camera’s view, so you can see where in the sky they’ll be at a specific time and place. Photographers can use it to plan their shots ahead of time, and businesses can use it to gauge things like how best to align solar panels to make the most efficient use of the angle of the sun.

The app uses multiple Google Maps APIs, including the Elevation API, the Time Zone API, the Google Maps SDK for iOS and the Google Maps Android API. The Android API, which includes Street View, was particularly helpful. It allowed me to overlay the path of the sun and moon on any Street View location anywhere in the world. For programming details, see this blog post.

The following screen captures give you a sense of how the app works. They show overlays on top of the iconic Half Dome in Yosemite National Park. The first shows the paths of the sun (yellow line) and moon (blue line) over an aerial view of Yosemite Valley. The green line shows the distance between the photographer and the object to be photographed — in this case, Half Dome.


This next screen capture shows how the app looks when in Street View mode. Again, the yellow line shows the sun’s path, and the blue line shows the moon’s path. The green line represents the horizon. You can see how the app lets you plan the right time to get a shot of the sun behind Half Dome: in this particular instance, 8:06 am.

Nearly 500,000 people around the world have downloaded the free version of Sun Surveyor, and many have paid for the full edition. They’re taking remarkable photos as a result, and what started as a hobby for me has turned into a business — thanks to Google Maps APIs.


Read More..

Tuesday, December 27, 2016

Google Redefines GPS Navigation Landscape Google Maps Navigation For Android 2 0

Google Redefines GPS Navigation Landscape: Google Maps Navigation For Android 2.0

Posted using ShareThis
Read More..

Friday, October 28, 2016

Google Vault now covers Hangouts for work chat


As an IT admin you want your organization to be free to focus on getting stuff done. But part of your role is also to make sure you stay on top of legal compliance. Today we’re making it a little bit easier to do both with two new Hangouts features.

Over the next few days, we’ll roll out an admin option that lets you manage Hangouts chat history in your organization, so that you can make certain that it’s either on or off. People in your organization can have the freedom to chat with whomever they want — whether that person is part of your organization or not — and you can be sure that new employee conversations stay personal and private, because they’ll disappear shortly after taking place.
We’re also adding Google Apps Vault support for Hangouts chat. With Vault support for chat, organizations of all sizes can quickly find and preserve chat messages. This is a great way to safeguard business-critical information for continuity, compliance and regulatory purposes.

Find out how to tailor Hangouts to best suit your organizations compliance needs.
Read More..

Tuesday, October 11, 2016

Obtain Google Maps API key


Step 1: Locate debug.keystore on your system. It is usually in the USER_HOMELocal SettingsApplication Data.androidfolder on windows.


Step 2: Use the keytool utility to generate certificate fingerprint (MD5). keytool utility that comes with the default JDK installation.


C:>keytool -list -alias androiddebugkey -keystore .androiddebug.keystore -storepass android -keypass android


It will getnerate a certificate fingerprint (MD5) in this format:


Certificate fingerprint (MD5): XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX


Step 3: Go to the page for obtaining the Maps API Key. Put your Certificate fingerprint (MD5) And get your API key for android Google Map application. On this page, paste the certificate fingerprint in the appropriate form field, and click the “Generate API Key” button. This will return a Maps API key string. 


The key can be used in the Maps Application by pasting it in the MapView element in the XML layout file where appropriate.

Read More..

Thursday, August 4, 2016

LINE Dragonica Mobile v1 1 12 APK Mod

Cover art
https://play.google.com/store/apps/details?id=google.as.dragonica.sea
Playpark proudly presents the Ultimate Side-Scrolling Action RPG of the year, LINE Dragonica Mobile!

Continuing its success from the PC, Playpark is bringing the familiar fantasy adventure into your smart phones.

? Comes with simple controls and Auto Play system for the ease of mobile and portable gaming.
? Ventures in astonishingly vibrant 3D fantasy worlds. Embark on journey to defeat the evil dragon Elga.
? Role-play as your favourite Dragon Hero classes: Warrior, Magician, and Thief!
? Special Skills development and upgrades to series of Combo attacks with a variety of weapons to choose from.
? Challenging Missions and Quests to hunt for Exclusive Prizes, Super rare Weapons and Armory!
? Fight for glory and honor in the daily Non-Stop Battle League system and prove yourself as the Strongest Dragon Hero in the virtual world.
? Customize your characters appearance in your own style with more than 200 customizables.
? Have your cute Pets to accompany you on your adventure. Evolve your pets to a higher rank to strengthen your overall attack and defense.
? Fun with your friends on LINE! Invite your LINE friends to play and challenge them for PvP to win a Special Rewards.


Install Line Dragonica Mobile now and start playing today! Exciting in-game events and plenty of rare items awaits for you!
Visit www.dragonica.playpark.com for more information.

[Recommend Specification]
Smartphone Android Dual Cores 1.5 GHz, RAM 1GB with Android 4.0 or later

Whats New

Dragonica Mobile - Hard Launch Version




Download LINE Dragonica Mobile v1.1.12 APK (Mod)
Read More..

Thursday, July 14, 2016

m Shadi"

samsung,mobile,sdk,–,introducing,the,complete,package
Read More..

Friday, July 8, 2016

Bring Android to work on your terms with Google Apps



With just the phone in your pocket, you can email your boss in Gmail and then ask your kids when they’ll be home using Hangouts. You can follow up with a new client in Salesforce and pull up your tax documents in Drive. Everything you do, whether its for work or your personal life can all be done from the device you always have by your side. That’s pretty powerful and can save a lot of time. But with great power comes great responsibility, and keeping that information secure requires some attention — whether it’s keeping your tax documents private to yourself or your email conversations secure within your company.

That’s why last week we made Android ready for work — making it easier for the more than one billion Android users out there to access the apps they need to be productive on their phones and tablets. Today we wanted to highlight the ways Google Apps Mobile Management let’s you take full advantage of Android for Work.

If you use Google Apps you already have a Mobile Management provider

Phones get lost. Tablets stolen. People leave the company. Things happen. We believe you should have the tools to keep your work data safe, and that this safety should just be built in to the applications you choose. That’s why mobile device management — across Android and iOS — is included with Google Apps and Google Drive for Work. Apps Mobile Management allows admins to see what devices are connected, require device passwords and remotely wipe data when necessary.

Security that’s easy to manage

As the domain administrator, with today’s launch, you can now choose the level of data separation that works for your organization. Whether it’s a personal device or a corp-issued one, with Android for Work, you can have all your employees create a Work Profile that isolates and protects work data from other activity on their phone. Or make it a choice, and let employees continue to switch accounts within Gmail and other Google mobile apps, while using the Work Profile for non-Google work related apps. Either way, all their work information is encrypted and can be remotely wiped.

The Work Profile keeps all work approved apps separate from the rest of the phone.

Easy to use

Google Play for Work makes it easy for employees to see what apps are approved by their company and install the apps they want onto their device. Once an admin enables Android for Work, anyone can choose to use the Work Profile, even if not required to. So their own information stays private while the company can enforce Mobile Management policies for work accounts if needed.
Install work apps from Google Play for Work and keep them on your homescreen.
With Google Apps Mobile Management, you can have choice and security at the same time. Your employees can choose the device they’re comfortable with that helps them get work done, and you have peace of mind that company information is secure. Android for Work and Apps Mobile Management is available for all Google Drive for Work and Google Apps for Work, Government and Education organizations. Learn more in the Admin Help Center.


Read More..

Friday, June 3, 2016

Allstate helps people uncover risks to their homes using Google Maps



Editors note: This month Google Maps turns ten! Since launching ten years ago, use cases for maps have come a long way. To celebrate a decade of mapping, we’re highlighting new and innovative ways developers are deploying maps. Read how guest blogger, Elizabeth Schreier, Director of Digital and Social Engagement at Allstate Insurance, is relying on Google Maps APIs to bring unique mapping experiences to their users.

Imagine looking at a map of your house and seeing a visual diagnosis of the biggest risks in your area — whether the risk is fire, theft or even freezing pipes. Then imagine getting helpful tips that could help you protect your home against those risks. That’s what we’ve done with GoodHome, a project we created at Allstate with our agency, T3.

We built GoodHome to make a tool that anyone would find useful, whether or not they were an insurance customer or even a homeowner. We realized we could use our proprietary information about insurance claims to help people identify the most common and costly claims in their respective ZIP codes. We decided to visualize this information, along with relevant property statistics, on an interactive map that included tips to help people mitigate potential risks.
We built GoodHome using the Google Maps APIs because of its familiarity, ease of use and comprehensive features. The development team at T3 created the GoodHome prototype using three Google Maps APIs: Static Maps, JavaScript and Street View Image APIs. They customized the maps by drawing layers, integrating a weather API and using CSS to create animations that brought the experience to life. The development process went smoothly and took just three months from concept to completion.

GoodHome is more than informative, it’s compelling. A visitor who uses the GoodHome tool is over 350% more likely to request an insurance quote than one who doesn’t. Forty percent of people type more than one address into the map, and on average, visitors stay on the site for six to seven minutes.

GoodHome also helps our agents build better relationships with customers. When an Allstate customer receives a link to the GoodHome website from their agent, the map automatically opens up to the customer’s home address. The personalized interaction helps agents connect with their clients and provide a great consulting tool that opens the door for a conversation. We plan to introduce GoodHome to all 10,000 Allstate agents across the country so they can spread the tool to their customers.

We’re excited to play a role in enhancing the home insurance experience for consumers. The power of Google Maps has helped us make a product that we hope will help people see their homes in a new way and think differently about what it means to protect what matters to them.
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..

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

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

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

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