- App to take, store and display photos using the Ionic 5 framework.
- Ionic/angular v5
- Ionic v5
- Angular v8
- Ionic DevApp, this has been retired - replaced by Capacitor to allow app to run on an iOS or Android device.
- Cordova-sqlite-storage v3, an Ionic Cordova Storage Plugin.
- To start the server on localhost://8100 type: 'ionic serve'
- The Ionic DevApp was installed on an Android device from the Google Play app store.
* takePicture() {
const options: CameraOptions = {
quality: 100,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE
};
this.camera.getPicture(options).then((imageData) => {
// Add new photo to gallery
this.photos.unshift({
data: 'data:image/jpeg;base64,' + imageData
});
// Save all photos for later viewing
this.storage.set('photos', this.photos);
}, (err) => {
// Handle error
console.log('The is a camera error: ' + err);
});
}
loadSaved() {
this.storage.get('photos').then((photos) => {
this.photos = photos || [];
});
}
- Displays photos taken.
- Status: compiles but Ionic Web Build fails. Tab 2 has access to a phone camera and it stores & displays the photos taken. There are still tabs 1 and 3 to develop.
- To-do: Add a lot more detail/styling to front page.
- Repo created by ABateman - feel free to contact me!