Giter VIP home page Giter VIP logo

abolfazlrezaee / nmock Goto Github PK

View Code? Open in Web Editor NEW
22.0 2.0 6.0 83.44 MB

NMock is an application that you can use to mock your trips with fake locations. This application uses Google Map SDK and Neshan API for Map and location information.

Kotlin 100.00%
android coroutines database gps-location hilt kotlin mock retrofit room-database sentry coroutines-android map reactive-programming sharedflow stateflow

nmock's People

Contributors

abolfazlrezaee avatar issavejdani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nmock's Issues

Fix flow of editing a Mock when player is under work

What's the problem or feature?

When the user plays a mock in MockPlayerService we should have a control on MockArchiveActivity to open the editor. now, if the player is playing a mock, we can edit that mock in MockArchiveActivity!

For the solution we want to

When the user plays a mock and we are in the MockArchiveActivity, we should check the activity that the user wants to edit, and if the mock is under play, we should show a dialog or snackbar that we can't edit the mock when we are playing it!

Works we should do during this task

  • Implement the new flow for better expreince

Readme file needs enhancement

What's the problem or feature?

The readme file has some grammar and sentence structure issues. It also needs steps on how to use the project and setup it up for yourself.

For the solution we want to

Fix some grammar issues and sentence structure problems that we have right now in our README.md file.

And this is the result.

Notify the user that we can't get the locations information out of Iran

What's the problem?

At this time we use Neshan Api for reverse Geocoding. but, Neshan has a limitation on Geocoding and that is, we can't get the information of locations out of Iran. and this is not good for users who live out of Iran.

For the solution we want to

For that, we should show a helper in MockEditorActivity. in this helper text, we should notify the user that "we can't get locations information that they are from out the Iran". this isn't a good solution, but for now, we don't have a choice.

Works we should do during this task

  • Implement a good design for that
  • Work on UX and make it good

Implement Import section(Section1: Import file with specific format)

What's the problem or feature?

In the first release of the application, I add a button in the Home section of the application that the name of that was Import. We have a plan for importing mocks in several ways in the application. the first part of importing mocks in the application is with files. this file has a specific format that application can export and import that.

For the solution we want to

For the first part, We want to research about a good format for files and also implement the import section of the application(import with files).

Works we should do during this task

  • Research about the good format of files for exporting and importing files in the application
  • Implement the UI of importing section of application
  • Implement the logic of the import section in the application
  • Add some logs for better debugging
  • Release the file format of import and export in the README file

Improve loading process of MockEditorActivity when we are trying to receive location information

What's the problem or feature?

We have a problem when our internet is not good. when the user long press on the map, in the loading state, if I long-press somewhere else, the marker is going to locate in the second long-press location. and that isn't good.

For the solution we want to

Probably, we should check the loading state in every long press, and if we are in the loading state, we shouldn't let the user to long-press on the map.

Works we should do during this task

  • Check loading state exists or not, if not, create it
  • Check the loading state in long-press functionality
  • Test the application

Implement account manager for saving user token and firebase token

What's the problem?

At this time we use Shared-Preferences for saving the user token. but this is not a good tool for saving user tokens. for better security, we should use Account Manager for saving sensitive user data!

For the solution we want to

As you understand, we must implement an account manager for saving user tokens on the phone. and we should manage all things that are related to that. such as logout or deleting accounts etc as well.

Works we should do during this task

  • Implement account manager
  • sync account manager with project
  • test and deploy

Improve camera fit to bound for mock route

when the user chooses the destination location, we draw the line on the map and after that, we fit the map to the route. but we have some problems on fit the route. sometimes we fit it wrong and sometimes we fit it well on screen. we should improve the functionality of that!

Fix opening of mock with intent of MockEditorActivity

after the user saves a mock in the database successfully, we show a dialog that says you can play this mock right now. so when we want to play it, MockPlayerActivity can't open the mock and get mock information.

Fix and improve code for mock Addresses

At this time, if we haven't an origin or destination address, we set these address properties as "Unknown" in MockRepositoryImpl. but we don't want to use this hardcode string here. so we should move this string to view and also improve functionalities that are related to.

Add logs file attachment to Coroutines exceptions reporter

when we have an exception thrown from the server or database, we show the "Unknown exception" message to the user and also send the HTTP codes(if the exception was from the server) or exception message(if the exception was from the database or something else). but this is not enough for debugging and some debug actions and processes. for that, we should attach the log file with the report and send that into the Sentry panel.

now, our problem is that we receive a lot of 470 HTTP codes from the map server for location information.

Use FileManager in NMockLogger functionalities

What's the problem or feature?

We wrote a manager that we call it FileManager in the application. this class is responsible for managing all functionalities related to files. in NMockLogger, we wrote all functionalities in a custom way.

For the solution we want to

For better code style and good architecture, it's better to use FileManager also for NMockLogger.

Works we should do during this task

  • Implement FileManager functionalities instead of custom way.
  • Test the result and be sure that it works

remove reporting logs file in UI and send it with crashes

What's the problem or feature?

Now We have a UI for sending logs reports to the Sentry by the user. but after some development, We have the capacity to send it with crashes and every situation that We want.

For the solution we want to

We want to remove that UI and fix code for sending files only with crashes to the Sentry

Works we should do during this task

  • Removing reporting logs file UI from the home page
  • check code and fix it for sending reports file if need
  • add README section for that

bugfix: targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE

Bug Stacktrace

java.lang.IllegalArgumentException: me.abolfazl.nmock: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:458)
at android.app.PendingIntent.getActivity(PendingIntent.java:444)
at android.app.PendingIntent.getActivity(PendingIntent.java:408)
at com.google.android.gms.common.GoogleApiAvailabilityLight.getErrorResolutionPendingIntent
at com.google.android.gms.common.GoogleApiAvailabilityLight.getErrorResolutionPendingIntent
at com.google.android.gms.common.GoogleApiAvailability.getErrorResolutionPendingIntent
at com.google.android.gms.common.GoogleApiAvailability.getErrorResolutionPendingIntent
at com.google.android.gms.common.GoogleApiAvailability.zaa
at com.google.android.gms.common.api.internal.GoogleApiManager.zac
at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.onConnectionFailed
at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.connect
at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zaa
at com.google.android.gms.common.api.internal.GoogleApiManager.handleMessage
at android.os.Handler.dispatchMessage(Handler.java:102)
at com.google.android.gms.internal.base.zap.dispatchMessage
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.os.HandlerThread.run(HandlerThread.java:67)

Using Google Map SDK instead of Neshan Map SDK

What's the problem or feature?

After all these versions that NMock had in these months, Neshan Map SDK isn't good as I expected in functionalities and performance. I decided to use Google Map SDK for learning new things and use new features for this application. this decision might change the Application Theme in the feature!

For the solution we want to

At the first, We just wanna replace Google Map SDK and fix functionalities with that.

Works we should do during this task

  • Research about Google Map SDK
  • Learn how to use the SDK
  • Implement a sample of that
  • Inserting Google Map SDK on the project
  • Replace Neshan functionalities with Google Map functionalities
  • Delete Neshan Map SDK from the project
  • Test all features again, and make sure all things are done properly
  • Have a good code review for the merge request

Recreate all flows of activities and fragments in application

What's the problem or feature?

One of the worst experiences that we have right now in the application is, Our back stack and flow of fragments and activities are so awful. for example you can see these issues that we have currently in application:

For the solution we want to

We wanna recreate the design of the application, create flow for the fragments and activities, implement new designs and then, implement the new functionalities for the new designs that we have. this task is big enough to work for it around a month...

Works we should do during this task

  • Recheck what we want in the application
  • Create a design concept for the application
  • Create the flow of design in the application
  • Implement the Design of the application
  • Implement functionalities of the application
  • Remove unnecessary resources
  • Test heavily the new design
  • Change the README.md file with new screenshots
  • Explain the flow of the application in the README.md file
  • Have a good review

Implement custom map style for Google Map SDK

What's the problem or feature?

After we migrated from Neshan Map SDK to the Google Map SDK, we have the capability to have our own style for the map in the application. we wanna create our custom map syle.

For the solution we want to

For that, Just @AbolfaZlRezaEe can do this. because you should have access to the Google Console for creating a custom style for the map. so, I do this implementation on my own.

Works we should do during this task

  • Implement new style using Google Console
  • Update README.md images
  • Test generally

Implement fake location provider

in MockPlayerService, we provide fake locations that those locations build a route for us. in this time, we want to generate fake locations for one place only. it means we just want to add a fake current location with some information that the user can choose.

This issue explanation isn't complete. I complete that in the future.

Fix wrong update functionality in mock section

What's the problem or feature?

We have a problem on updating mock positions now. in normal-position and imported-position. when we want to update the mock position list on the database, we remove the oldest one and insert the new one in the database. that is wrong because the id grows up unnecessarily.

For the solution we want to

Fix relation functionality of position entities in the database at first, and fix update functionalities in the second.

Works we should do during this task

  • Fix the relation of position tables in the database
  • Fix functionalities of update positions in code

Wrong logging server exceptions in repositories

What's the problem or feature?

When the exception is thrown from the server and we receive it in repositories, we try to log it and send it to the Sentry. but we capture these messages in the wrong way.

For the solution we want to

We should fix it and check it to sure that the message sends successfully in the right format to the Sentry.

Works we should do during this task

  • Fix the messages
  • Check and test

bugfix: Force close on starting mockPlayerService with intent

Bug stack trace:

java.lang.IllegalArgumentException: me.abolfazl.nmock: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:458)
at android.app.PendingIntent.getActivity(PendingIntent.java:444)
at android.app.PendingIntent.getActivity(PendingIntent.java:408)
at me.abolfazl.nmock.view.player.MockPlayerService.onCreate(MockPlayerService.kt:5)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4607)
at android.app.ActivityThread.access$1800(ActivityThread.java:264)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8105)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)

Implement Signin and Signup section for application

before adding the firebase server to the application, we should know the user information and we should capacity to track the firebase token that firebase gives us. To provide that, we must implement a sign-in and sign-up section.

Implement exporting mocks files just for trips

What's the problem or feature?

In order to present the import section in application, we should have a special pattern for creating mock export files.

For the solution we want to

We want to export the mock that we want, and share it via android share section. we decided to choose JSON as the format of file.

Works we should do during this task

  • Redesign Archive section of application
  • Implement export design for application
  • Add some logs for better debugging
  • Release the file format of import and export in the README file

Implement NPack application for main application

after we implement the firebase server section, we should have a place to manage push requests, send push notifications, send some other pushes, and so on. for that I decided to make a separate application and use that for this purpose.

I monitor the state of this application with some tasks in Project section.

Notice that I don't publicize this extra application because it doesn't need to be public...

Implement pusher for application

What's the problem or feature?

After implementing Auth section for the application, we want to send the pusher token to the server for generating some information for providing the push process for us. for that, we should get the user information, and then send it to the pusher and receive the token that the pusher gave us.

For the solution we want to

Implement pusher functionalities and also implement getting user information from the server. connect these together and receive the token that the pusher gave us.

Works we should do during this task

  • Implement getting user information from the server
  • Implement pusher functionalities with user_id that the server gave us
  • Implement a simple UI to show user's full name and email

Add push notification with firebase in project

after we add the logger utils, we should have the capability to show notifications to the user. this thing helps us to connect to the user and ask them to help us to improve our application.

Remove GPS request Snackbar in MockPlayerActivity when the user manually turns on it

What's the problem or feature?

When the user wanna use MockPlayer and play a mock, if their location is off, we will show a snack bar that says:"Turn on the location to use this feature". but if we show this message to the user and the user turns on the location on the notification bar, we don't hide the snack bar after that.

For the solution we want to

We should listen to the changing state of location, and then when the user turns it on, we must hide the snack bar.

Works we should do during this task

  • Implement a listener for that
  • Add some logs for better debugging
  • Test and Deploy

Add a Service for user current location

at this time, we provide the last location with a function in mockEditorActivity, but this way of getting the location from fusedLocationProvider has disadvantages for us.
so we must create and develop a service that gives us the live location. with that, we can do a lot of things...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.