Cameras Viewer - Android App Source CodeCameras Viewer - Android App Source Code
Application is webcameras images viewer. (jpeg still images and video streams)Cameras Viewer - Android App Source Code
Application is webcameras images viewer. (jpeg still images and video streams)Overview
Application is webcameras images viewer.
It is designed to be used with widespread jpg cameras (still images with refresh interval)
but can be used with real videos stream if Android VideoView support those streams.
Features
App shows as pager different aspects of cameras (all cameras, groups, countries if supports multiple countries,
time lapse cameras (streams and images with frequent refresh interval) and favorites)
You can preview camera image in grid and open for further viewing cameras you want.
You can swipe cameras right and left in selected list, group, countries, favorites...
You can add/remove camera to favorite for quick access later.
You can share image from camera you are viewing to any app that supports share image.
Requirements
Android studio to open project and build apk.
You should replace app icon with your own unique icon.
Instructions
Cameras are defined in cameras.json file.
We have defined several cameras so you can see format required.
{
"id": 610000023,
"city": "Loreto, Baja California Sur",
"country": "Mexico",
"interval": 7.0,
"name": "Villa del Palmar Loreto",
"source": "http://www.cabovillas.com",
"urlPart1": "http://www.cabocast.com/webcam_images/",
"urlPart2": "13_xlarge.jpeg",
"stream": "",
}
id - some unique number as you provided
city - city or any other group of your cameras (road, region, province...)
country - Country of your camera. If you have multiple countries set IS_FOR_MULTIPLE_COUNTRIES to true in ControlCamerasConfiguration java file.
interval - If you add real stream set it to 0 otherwise set it to number of seconds to refresh image (that depends have often server reloads image at the first place)
name - Camera name to show
source - Source url to respect copyright of camera owner.
urlPart1 and urlPart2 is set when using image camera. This is image url broken in 2 parts url start and filename.
stream - If you set real stream url like "stream": "http://mcleansfs4.tdotstreaming.com:1935/rtplive/R4_017/playlist.m3u8"
If you want to use admob in your application you have to set in AndroidManifest.xml meta data for:
android:name="com.google.android.gms.ads.APPLICATION_ID" and admobInterstitialId for interstitial and admobId for banner id
App is distributed with demo ids.
You have further options in ControlCamerasConfiguration
public static final boolean DISABLE_ADS = false;
- to disable ads showing
public static final int SHOW_AD_IN_MINUTES = 10;
- minimal pause betwen 2 interstitial
public static final boolean INTERSTITIAL_ADS_ALWAYS_FOR_TESTING_ONLY = true;
- show ads on every camera open for testing
public static final boolean INTERSTITIAL_ADS_NEVER_FOR_TESTING_ONLY = false;
- do not show ads on cameras open so you can test camera without dealing with ads
public static final boolean DISPLAY_SERVER_SNAPSHOTS = false;
- For more advanced and complicated setups. You can download camera snapshots to your server and enable this option to speed up loading of preview images when camera providers are too slow
You have to redefine getCameraSnapshotUrl method to set your site urls for snapshots
public static String getCameraSnapshotUrl(final CameraDescription cameraForName) {
return "http:/" + "/snapshots.insertmysitehere.com/webcams/" + cameraForName.getCameraId() + ".jpg";
}
public static final boolean ENABLE_STREAMS = true;
- if you want to disable real stream cameras
public static final boolean IS_JSON_DATA_REMOTE = false;
public static final boolean IS_JSON_DATA_REMOTE_ONLY = false;
- to load cameras.json from remote server so you do not have to update apk to update list of cameras.
You have to change getUrlRemoteJsonCameras for this
public static String getUrlRemoteJsonCameras(final String applicationId) {
return "http:/" + "/www.insertmysitehere.com/json/" + applicationId + ".json";
}
private static final String URL_FULL_NO_IMAGE_FOUND_PNG = "file:/" + "/" + "/android_asset/noimagefound.png";
private static final String URL_FULL_NO_PREVIEW_IMAGE_FOUND_PNG = "file:/" + "/" + "/android_asset/nopreviewimagefound.png";
- Assets url for images to show if cameras image broken / not loading for whatever reason.
Future product updates
Quality checked by Codester
Lowest price guarantee
Category | App Templates / Android / Applications / Utility |
First release | 20 November 2020 |
Last update | 10 December 2020 |
Operating Systems | Android 7.0, Android 8.0, Android 9.0, Android 10.0, Android 6.0 |
Files included | .apk, .java, .xml |
Tags | images, viewer |