If you're trying to do this, you came to the right place!
See this code in action here: https://twitter.com/CodingDoug/status/953031540811825152
- Create a Firebase project at the Firebase Console
If you're trying to do this, you came to the right place!
See this code in action here: https://twitter.com/CodingDoug/status/953031540811825152
| // Copyright 2017 Google LLC. | |
| // | |
| // Licensed under the Apache License, Version 2.0 (the "License"); | |
| // you may not use this file except in compliance with the License. | |
| // You may obtain a copy of the License at | |
| // | |
| // https://www.apache.org/licenses/LICENSE-2.0 | |
| // | |
| // Unless required by applicable law or agreed to in writing, software | |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| <html> | |
| <body> | |
| <h2>Privacy Policy</h2> | |
| <p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended | |
| for use as is.</p> | |
| <p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and | |
| disclosure of Personal Information if anyone decided to use [my|our] Service.</p> | |
| <p>If you choose to use [my|our] Service, then you agree to the collection and use of information in | |
| relation with this policy. The Personal Information that [I|we] collect are used for providing and | |
| improving the Service. [I|We] will not use or share your information with anyone except as described |
| package com.memtrip; | |
| import java.io.FileNotFoundException; | |
| import java.io.IOException; | |
| import java.io.OutputStream; | |
| import android.content.ContentResolver; | |
| import android.content.ContentUris; | |
| import android.content.ContentValues; | |
| import android.graphics.Bitmap; |
| View.OnTouchListener detectClickAndHoldListener = new View.OnTouchListener() { | |
| private Timer timer = new Timer(); | |
| private long LONG_PRESS_TIMEOUT = 1337; // TODO: your timeout here | |
| private boolean wasLong = false; | |
| @Override | |
| public boolean onTouch(View v, MotionEvent event) { | |
| Log.d(getClass().getName(), "touch event: " + event.toString()); |
| <!-- MIT License | |
| Copyright (c) 2016 Derrick Rono | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
| public class Main { | |
| static ValueEventListener mListener; | |
| public static void main(String[] args) throws Exception { | |
| Firebase ref = new Firebase("https://<your-app>.firebaseio.com/"); | |
| mListener = ref.addValueEventListener(new ValueEventListener() { | |
| @Override | |
| public void onDataChange(DataSnapshot snapshot) { | |
| if (snapshot.exists()) { | |
| System.out.println("The value is now "+snapshot.getValue()); |
| public final class MapStyleManager implements GoogleMap.OnCameraMoveListener { | |
| private final Context context; | |
| private final GoogleMap map; | |
| private final GoogleMap.OnCameraMoveListener onCameraMoveListener; | |
| private final TreeMap<Float, Integer> styleMap = new TreeMap<>(); | |
| @RawRes | |
| private int currentMapStyleRes = 0; |