{"id":13614813,"url":"https://github.com/PDDStudio/earthview-android","last_synced_at":"2025-04-13T20:32:22.004Z","repository":{"id":96423204,"uuid":"47778950","full_name":"PDDStudio/earthview-android","owner":"PDDStudio","description":"A library to include 'EarthView with Google' into your application with ease.","archived":false,"fork":false,"pushed_at":"2017-05-11T09:23:11.000Z","size":54486,"stargazers_count":139,"open_issues_count":5,"forks_count":28,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-08-02T20:46:30.588Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PDDStudio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-12-10T18:08:05.000Z","updated_at":"2024-05-28T06:41:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"9b9c479a-d178-46f7-95e9-57db30eeea80","html_url":"https://github.com/PDDStudio/earthview-android","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PDDStudio%2Fearthview-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PDDStudio%2Fearthview-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PDDStudio%2Fearthview-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PDDStudio%2Fearthview-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PDDStudio","download_url":"https://codeload.github.com/PDDStudio/earthview-android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223605437,"owners_count":17172488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T20:01:05.928Z","updated_at":"2024-11-07T23:30:25.796Z","avatar_url":"https://github.com/PDDStudio.png","language":"Java","readme":"# EarthView Android Library\nA simple and easy to use API to integrate [EarthView with Google](http://earthview.withgoogle.com) into your android application.\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-earthview--android-green.svg?style=true)](https://android-arsenal.com/details/1/2902)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.pddstudio/earthview-android/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.pddstudio/earthview-android)\n\n## Showcase\n### Advanced Demo Application (Beta)\nTo showcase the different possibilities of this library I've created a demo 'Wallpaper Application'.\nYou can find the source for this application in the `ps-app/` folder.\nIn case you want to install the Application, feel free to do so! **It's on Google Play™**\n\n[![](https://github.com/PDDStudio/earthview-android/blob/master/preview/en-play-badge.png)](https://play.google.com/store/apps/details?id=com.pddstudio.earthviewer)\n\n### !! Translators needed !!\nYou can help translating EarthViewer into your native language via OneSkyApp: [Contribute to EarthViewer](http://goo.gl/z4218r)\n\n### Advanced Demo Screenshot\n![ ](https://github.com/PDDStudio/earthview-android/blob/master/preview/screenshot.png)\n### Simple Demo Application\nYou can find a simple demo application in the `app/` folder which you can also download [here](https://github.com/PDDStudio/earthview-android/raw/master/app-debug.apk).\n\n## Getting Started\nInclude the library into your project by adding the following line to your ```build.gradle```:\n```compile 'com.pddstudio:earthview-android:[VERSION]'```\n**Note:** *To make sure you're using the latest version, take a look at the maven badge above*\n\n## Usage\n - 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.\n- Get an instance of the EarthView by calling:\n```java\nEarthView.withGoogle()\n```\n- Fire the event which fit's your needs, you'll get the results through the callback interface you provide in your project.\n\n### Fetching a single EarthView\n\nA quick sample to fetch a single EarthView\n\n```java\npublic class MainActivity extends AppCompatActivity implements SingleEarthViewCallback {\n\n    Button loadBtn;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\n        setSupportActionBar(toolbar);\n\n        loadBtn = (Button) findViewById(R.id.load_wall_btn);\n        loadBtn.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n\t        //in case you want to get a random wallpaper\n            EarthView.withGoogle().getRandomEarthWallpaper(MainActivity.this);\n\t        //in case you want to get a specific EarthWallpaper\n\t\t    EarthView.withGoogle().getEarthWallpaper(earthWallpaperIdentifier, this);\n            }\n        });\n    }\n    @Override\n    public void onStartedLoading() {\n        //in case you want to show a loading dialog or anything else\n    }\n\n    @Override\n    public void onFinishedLoading(EarthWallpaper earthWallpaper) {\n        //check whether the result is null or not\n        if(earthWallpaper != null) {\n            //do whatever you want to do with the EarthWallpaper object\n        }\n    }\n\n\n}\n```\n\n### Fetching multiple EarthViews\n\nA quick sample to load multiple EarthViews:\n\n```java\npublic class MainActivity extends AppCompatActivity implements EarthViewCallback {\n\n    Button loadBtn;\n   \n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\n        setSupportActionBar(toolbar);\n\n        loadBtn = (Button) findViewById(R.id.load_wall_btn);\n        loadBtn.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                EarthView.withGoogle().getAllEarthWallpapers(MainActivity.this);\n            }\n        });\n    }\n\n    @Override\n    public void onStartedLoading() {\n\t\t//in case you want to show a loading dialog or something else you can do this here\n    }\n\n    @Override\n    public void onItemLoaded(EarthWallpaper earthWallpaper) {\n        //just to be sure the result isn't null\n        if(earthWallpaper != null) {\n\t\t//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\n        }\n    }\n\n    @Override\n    public void onFinishedLoading(Collection\u003cEarthWallpaper\u003e earthWallpapers) {\n\t\t//here you can stop showing the loading dialog\n\t\t//in case you don't want to handle each item seperately the complete Collection of EarthWallpapers is provided here, too \n    }\n}\n```\n\n## The EarthWallpaper reference sheet\nOnce you received an EarthWallpaper object through the callback you can get the following information out of it:\n- The EarthView's ID (identifier - similar to the original one)\n- The EarthView's Slug\n- The EarthView's Url (Link to the official Site for this EarthView)\n- The EarthView's Title (Official Title for this EarthView)\n- The EarthView's Latitude\n- The EarthView's Longitude\n- The EarthView's Photo Url (In case you want to load it into an ImageView or save it to your storage)\n- The EarthView's Thumbnail Url (Recommended when fetching a lot of EarthViews - to reduce bandwith)\n- The EarthView's Download Url (The official Url to download this EarthView)\n- The EarthView's Region (Region where this EarthView was taken)\n- The EarthView's Country (The Country this EarthView was taken)\n- The EarthView's Attribution (Copyright information)\n- The EarthView's GoogleMaps Url (To show the direct position of this EarthView)\n- The EarthView's GoogleMaps Title (Can be used for wrapping around the GoogleMaps Url e.g)\n\nAll information can be fetched via their get-Methods.\nYou can find more information in the EarthView JavaDoc.\n\n## Dependencies (Library)\n- [Gson](https://github.com/google/gson)\n- [Apache Commons IO](https://commons.apache.org/proper/commons-io/)\n- [OkHttp](http://square.github.io/okhttp/)\n\n## Dependencies (Simple Demo Application)\n- [Picasso](http://square.github.io/picasso/)\n\n**Note:** *Dependencies for the Advanced Demo can be found inside the application*\n\n## About \u0026 Contact\n- In case you've a question feel free to hit me up via E-Mail (patrick.pddstudio@googlemail.com) \n- or [Google+](http://plus.google.com/+PatrickJung42)\n\n## Contributors\n*A special thanks goes to everyone who contributed to this project!*\n- [Alex Lionne](https://github.com/AlexLionne)\n\n## License\n    Copyright 2015 Patrick J\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.","funding_links":[],"categories":[":shamrock:  **Categories**"],"sub_categories":[":gear: Utilities"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPDDStudio%2Fearthview-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPDDStudio%2Fearthview-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPDDStudio%2Fearthview-android/lists"}