A library to include 'EarthView with Google' into your application with ease.

Overview

EarthView Android Library

A simple and easy to use API to integrate EarthView with Google into your android application.

Android Arsenal Maven Central

Showcase

Advanced Demo Application (Beta)

To showcase the different possibilities of this library I've created a demo 'Wallpaper Application'. You can find the source for this application in the ps-app/ folder. In case you want to install the Application, feel free to do so! It's on Google Play™

!! Translators needed !!

You can help translating EarthViewer into your native language via OneSkyApp: Contribute to EarthViewer

Advanced Demo Screenshot

Simple Demo Application

You can find a simple demo application in the app/ folder which you can also download here.

Getting Started

Include the library into your project by adding the following line to your build.gradle: compile 'com.pddstudio:earthview-android:[VERSION]' Note: To make sure you're using the latest version, take a look at the maven badge above

Usage

  • Implement either SingleEarthViewCallback (for a single EarthView) or EarthViewCallback (for multiple EarthViews) into your Activity, Adapter or any other class where you want to load the EarthView's.
  • Get an instance of the EarthView by calling:
EarthView.withGoogle()
  • Fire the event which fit's your needs, you'll get the results through the callback interface you provide in your project.

Fetching a single EarthView

A quick sample to fetch a single EarthView

public class MainActivity extends AppCompatActivity implements SingleEarthViewCallback {

    Button loadBtn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        loadBtn = (Button) findViewById(R.id.load_wall_btn);
        loadBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
	        //in case you want to get a random wallpaper
            EarthView.withGoogle().getRandomEarthWallpaper(MainActivity.this);
	        //in case you want to get a specific EarthWallpaper
		    EarthView.withGoogle().getEarthWallpaper(earthWallpaperIdentifier, this);
            }
        });
    }
    @Override
    public void onStartedLoading() {
        //in case you want to show a loading dialog or anything else
    }

    @Override
    public void onFinishedLoading(EarthWallpaper earthWallpaper) {
        //check whether the result is null or not
        if(earthWallpaper != null) {
            //do whatever you want to do with the EarthWallpaper object
        }
    }


}

Fetching multiple EarthViews

A quick sample to load multiple EarthViews:

public class MainActivity extends AppCompatActivity implements EarthViewCallback {

    Button loadBtn;
   
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        loadBtn = (Button) findViewById(R.id.load_wall_btn);
        loadBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                EarthView.withGoogle().getAllEarthWallpapers(MainActivity.this);
            }
        });
    }

    @Override
    public void onStartedLoading() {
		//in case you want to show a loading dialog or something else you can do this here
    }

    @Override
    public void onItemLoaded(EarthWallpaper earthWallpaper) {
        //just to be sure the result isn't null
        if(earthWallpaper != null) {
		//here you can handle what you want to do with the new item - this event get's fired every time the library has loaded a new EarthView object
        }
    }

    @Override
    public void onFinishedLoading(Collection<EarthWallpaper> earthWallpapers) {
		//here you can stop showing the loading dialog
		//in case you don't want to handle each item seperately the complete Collection of EarthWallpapers is provided here, too 
    }
}

The EarthWallpaper reference sheet

Once you received an EarthWallpaper object through the callback you can get the following information out of it:

  • The EarthView's ID (identifier - similar to the original one)
  • The EarthView's Slug
  • The EarthView's Url (Link to the official Site for this EarthView)
  • The EarthView's Title (Official Title for this EarthView)
  • The EarthView's Latitude
  • The EarthView's Longitude
  • The EarthView's Photo Url (In case you want to load it into an ImageView or save it to your storage)
  • The EarthView's Thumbnail Url (Recommended when fetching a lot of EarthViews - to reduce bandwith)
  • The EarthView's Download Url (The official Url to download this EarthView)
  • The EarthView's Region (Region where this EarthView was taken)
  • The EarthView's Country (The Country this EarthView was taken)
  • The EarthView's Attribution (Copyright information)
  • The EarthView's GoogleMaps Url (To show the direct position of this EarthView)
  • The EarthView's GoogleMaps Title (Can be used for wrapping around the GoogleMaps Url e.g)

All information can be fetched via their get-Methods. You can find more information in the EarthView JavaDoc.

Dependencies (Library)

Dependencies (Simple Demo Application)

Note: Dependencies for the Advanced Demo can be found inside the application

About & Contact

Contributors

A special thanks goes to everyone who contributed to this project!

License

Copyright 2015 Patrick J

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

   http://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,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Cache Management

    Cache Management

    I don't know If cache is optimized (much images are loaded). Why not adding this as option ? It should reduce cache but user will need to sync again each time

     Picasso.with(context).load(url).memoryPolicy(MemoryPolicy.NO_CACHE )
                            .networkPolicy(NetworkPolicy.NO_CACHE).into(imageView)
    
    opened by AlexLionne 2
  • Add landscape mode

    Add landscape mode

    The sample is almost landscape compatible, I've to fix that the adapter starts reloading all wallpapers when changing the orientation. It should continue loading from it's current position

    enhancement wontfix EarthViewer [Application] 
    opened by PDDStudio 1
  • Change hardcoded string

    Change hardcoded string

    Modification of the hard coded string, preventing from "@string/muzei_settings_dialog_checkbox" to be displayed/translated https://plus.google.com/115610928059890728494/posts/7WvNqHY4oWL

    opened by KevinMinions 0
  • Added & Improved Muzei support

    Added & Improved Muzei support

    Added possibillity to select EarthViewer as Source via Muzei. Added possibillity to change the switch-interval from 1min up to 180hrs Reference issue #14

    opened by PDDStudio 0
  • 1.1.0 Release

    1.1.0 Release

    • Added Copyright/License header
    • Removed unused/redundant AsyncTasks
    • Added improvements from Issue #1
    • Added callback function which can be invoked in case an operation gets cancelled
    • Updated EarthView ID's
    opened by PDDStudio 0
  • AsyncTask improvement(s)

    AsyncTask improvement(s)

    Currently all tasks executed via an EarthView instance can only be runned once. This needs to be fixed so every task can be called multiple times. Also the OkHttp Exception which is thrown when cancelling a running task needs to be catched and stopped properly

    bug EarthView Android [Library] 
    opened by PDDStudio 0
  • Android M permissions

    Android M permissions

    Why don't You ask for permissions on main activity? If one goes to the settings would not be able to change the 'Wallpaper export location' since permissions are asked only when downloading a wallpaper. I think it would be easier and it would require only few lines of code

    private final static int READ_EXTERNAL_STORAGE_PERMISSION_REQUEST=1;
    

    and onCreate

    if (Build.VERSION.SDK_INT >= 23 && PermissionChecker.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PermissionChecker.PERMISSION_GRANTED) {
                requestPermissions(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, READ_EXTERNAL_STORAGE_PERMISSION_REQUEST);
            }
    

    You can also explain why you need permissions if You want

    @Override
        public void onRequestPermissionsResult (int requestCode, String[] permissions, int[] grantResults) {
            if(requestCode==READ_EXTERNAL_STORAGE_PERMISSION_REQUEST && grantResults[0]!=PermissionChecker.PERMISSION_GRANTED) {
                Utils.showMessageDialog();
            }
        }
    

    showing a simple dialog using material dialogs library:)

    public void showMessageDialog() {
            new MaterialDialog.Builder(this)
                    .title(R.string.permissions_title)
                    .content(R.string.explain_why)
                    .positiveText(android.R.string.ok)
                    .negativeText(android.R.string.no)
                    .show();
        }
    

    just a hint :) I don't have a working as, or I would have sent a pull request:)

    enhancement EarthViewer [Application] 
    opened by enricocid 1
  • Add Intro when launching application for the first time

    Add Intro when launching application for the first time

    There should be a short intro activity when the user launches the app for the first time, this looks more nicely as currently it's immediately starting to load images (if on wifi)

    enhancement EarthViewer [Application] 
    opened by PDDStudio 0
  • Reduce mobile data usage

    Reduce mobile data usage

    There should be only a few wallpapers loading in case a user isn't connected to a wifi network to prevent loading all +1500 images. When changing to details activity the full resolution image shouldn't be loaded until desired by the user.

    enhancement EarthViewer [Application] 
    opened by PDDStudio 0
Owner
Patrick Jung
Linux, Android and Open-Source enthusiast.
Patrick Jung
Candash - A simple Android app that turns your phone into an instrument cluster for your Tesla Model 3 and Y

What is CANdash? CANdash is an Android app that turns your Android device into a

Nick Nguyen 31 Nov 5, 2022
This application uses Google Play Services Vision library to scan barcodes. It uses Google's on device ML kit to scan for barcodes.

Barcode-Scanner This application showcases use of Google Play Services Vision library It uses Google's on device machine learning kit to scan for barc

Soumik 2 Apr 28, 2022
COVID-19 Diagnosis at Ease

Cough It COVID-19 Diagnosis at Ease Inspiration As the pandemic has nearly crippled all the nations and still in many countries, people are in lockdow

null 12 Jan 11, 2022
Idaesbasic - An all in one project manager that stores everything in files directly into your project! 🤯

Idaesbasic - Project-Managment redefined Idaesbasic Everything is a file ?? With this project managment tool, everything is a file. Your todolists are

Ben Herbst 123 Nov 11, 2022
AptiBit is an android application that uses Firebase firestore to store the questions and categorize different types of aptitude questions into their categories

AptiBit is an android application that uses Firebase firestore to store the questions and categorize different types of aptitude questions into their categories. It also uses firebase authentication service that allows you to sign in to the app using your custom credentials.

Ashish Gupta 3 Jun 13, 2022
xCloud player for Google Chromecast with Google TV

XCTV Player An awesome Microsoft xCloud player for Google Chromecast with Google

Keith Baker 41 Dec 27, 2022
Google one tap sign in - Flutter Google One Tap Sign In (Android)

Google One Tap Sign In Google One Tap Sign In (Android) A Flutter Plugin for Google One Tap Sign In Getting Started To access Google Sign-In, you'll n

null 6 Nov 23, 2022
Xctvplayer - xCloud player for Google Chromecast with Google TV

XCTV Player An awesome Microsoft xCloud player for Google Chromecast with Google

Keith Baker 41 Dec 27, 2022
A dummy application used for POC for Future of Furniture application using AR serivces provided by Google.

Furture A dummy application used for POC for Future of Furniture application using AR serivces provided by Google. Demo video.mp4 Splash Home Sofa Cha

Kapil Yadav 8 Nov 28, 2022
Android app that allows you to draw anything and turn it into a jigsaw puzzle.

Android-Jigsaw-Puzzle Like to draw? Like to solve jigsaw puzzles? Try JigDraw! This is an Android app where a user draws something and use it to gener

Jay Paulynice 149 Nov 24, 2022
Android App to save shares from any app into a file.

Save To… Android App to save shares from any app into a file. Download · Website · Contact About the Project Exporting data from any app into a file m

Daniel Gehrer 2 Oct 19, 2022
Bringing webhooks into Telegram. Push messages to chats via URL with a simple API.

Webhooks over Telegram (WoT) WoT aims to provide a simple API for registering webhooks and sending messages to Telegram chats via them using a single

d1s utils 2 Oct 5, 2022
An Android app to stream and download your media stored in Google Drive in an Awesome way !!

⚡ Thunder : An Android app to stream and download your media stored in Google Drive in an Awesome way !! (Just Movies for now) ?? Getting Started : Le

null 278 Jan 5, 2023
Google Play Market's clone application

PlayMarketClone Google Play Market's clone application Features of the application: Images are retrieved from the API The application has a single act

Lazy Coder 3 Dec 3, 2022
This Android application demonstrates new splash screen API launched by Google last year.

This Android application demonstrates new splash screen API launched by Google last year.

Mohit Rajput 1 Feb 22, 2022
Google Developer Student Clubs 2022 Solution Challenge - Team East River's Android Application

Solution-Challenge-2022-VEGATHER Google Developer Student Clubs 2022 Solution Challenge - Team East River's Android Application VEGATHER is an app ser

GDSC HUFS 5 Jun 19, 2022
AppUI Sample Application - display how you can create your own custom AppUI application within a few minutes

AppUI Sample Application This is an open-source project to display how you can create your own custom AppUI application within a few minutes. I have a

Formaloo 5 Sep 5, 2022
:movie_camera: Movie discovery app showcasing Android best practices with Google's recommended architecture: MVVM + Repository + Offline support + Android Architecture Components + Paging library & Retrofit2.

Popular Movies Stage 1 + Stage 2 Discover the most popular and top rated movies playing. Movies data fetched using themoviedb.org API. ✨ Screenshots M

Yassin AJDI 189 Nov 26, 2022