Tuwaiq Academy Second Project. NEARMe Android Application
This project represents an android application NEARMe, which helps the user display images based on their current location plus navigate to any image anywhere.
This application was built using the following technologies:
-
Canva
-
Adobe Photoshop
-
Figma
-
Adobe Photoshop
- IntelliJ IDEA for improving code quality.
- Android Architecture Components:Room,LiveData,ViewModel and Data binding.
- Room DataBase.
- RecyclerViews & Adapters.
- Required Libraries
- Figma
- Google map
- Flikr Api
link to Figma Figma Wireframe
-
As a user,I want to see the pictures in my location so that I can see the places near me.
-
As a user, I would like to be able to choose any location on the map so that I can the picture in that location.
-
As a user I want to see the details of each image so that I can see additional information about it (such as title and date taken) .
-
As a user I want to share images so that I can sent it to other people.
-As a user I want to see the recent images offline so that I can use the app without internet connection.
Follow the steps below to get started with the project's development environment:
- Install Android Studio from Android Studio
- Clone this repository:
$ git clone https://github.com/WalaaAlshaikh/NEARMe.git
- Navigate to the project directory:
$ cd NEARMe
- List of the depencenceies used in the project:
- for navigation fragments
dependencies {
implementation "androidx.navigation:navigation-fragment-ktx:2.3.5"
implementation "androidx.navigation:navigation-ui-ktx:2.3.5"
}
- for notification:
val core_version = "1.6.0"
dependencies {
implementation("androidx.core:core-ktx:$core_version")
}
- for ViewModel
dependencies {
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0-rc01"
implementation "androidx.fragment:fragment-ktx:1.3.6"
}
- for live data
dependencies {
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.0-rc01"
}
- for Room Database
dependencies {
id 'kotlin-kapt'
implementation "androidx.room:room-runtime:2.3.0"
implementation "androidx.room:room-ktx:2.3.0"
kapt "androidx.room:room-compiler:2.3.0"
}
- for coroutines
dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2'
}
- for Images
dependencies {
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
}
- for map
dependencies {
// for current location
implementation 'com.google.android.gms:play-services-location:18.0.0'
//for enabling map
implementation 'com.google.android.gms:play-services-maps:18.0.0'
}
Firstly, Our developer team brainstormed some ideas related to the requirement of to the app and then took a general idea of the design and the mechanisim of some popular apps from app store Secondly, we designed a logo according to the purpose of the app and gave it name. Thirdly, we designed the screens each of them suitable for a specific action using the Figma and Photoshop,after that we statred programming the app using the android studio by dividing the project into several tasks that each member of the team work on it: at first, we installed the required libraries and dependencies and the required api from FlikrApi. For many problems that we faced,we needed first to decide the nature of the error (if it's syntax, runtime or logical), and then find the solution accordingly.Such solutions that can be disovered when debugging the error, using (Log.d)to specifty the location of the error, searching for similar cases online in stackoverflow and asking for the help of the experts.
- seeting the favourite image in a separate list which can potentially fixed by using a certain api from FlikrApi and do the authentication .
- some bugs regarding maps such as the marker would not disappear when moving to another place .
- some minor issues regarding the enhancment of the design to make the user expereince more dynamic.
- sharing images it is useful when you want to send a certain image to any app.
val image:Bitmap?= getBitmapFromView(binding.imageItem)
val share= Intent(Intent.ACTION_SEND)
share.type="image/*"
share.putExtra(Intent.EXTRA_STREAM,getImageUri(requireActivity(),image!!))
startActivity(Intent.createChooser(share, "Share Via:"))
}
}
/// those two functions for sharing the pic
private fun getBitmapFromView(view: ImageView):Bitmap?{
val bitmap= Bitmap.createBitmap(view.width,view.height,Bitmap.Config.ARGB_8888)
val paint=Canvas(bitmap)
view.draw(paint)
return bitmap
}
private fun getImageUri(inContext:Context, inImage:Bitmap): Uri?{
val byte=ByteArrayOutputStream()
inImage.compress(Bitmap.CompressFormat.JPEG,100,byte)
val path= MediaStore.Images.Media.insertImage(inContext.contentResolver,inImage,"Title",null)
return Uri.parse(path)
}
- using Bundle It is useful when you want to pass a specific data from one fragment to another.
// in first fragment
var bundle= bundleOf("Lat" to imageViewModel.lat,"Long" to imageViewModel.long)
}
/// in second fragment
if(arguments!= null)
{
imageViewModel.lat=requireArguments().getDouble("Lat")
imageViewModel.long= requireArguments().getDouble("Long")
}