abolfazlrezaee / nmock Goto Github PK
View Code? Open in Web Editor NEWNMock 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.
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.
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!
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!
for using firebase push notification, we wrote some processes for that. but I think we have some different things on the new API that firebase system gives us with the server that we will run. we should re-check the push process and sync the code with the new API!
after the first release, we have a problem with debugging crashes and logs that I receive from the sentry. these logs don't have much data for debugging and I should have a file to write all my logs into it.
after that, we should have the capacity to send this file to the Sentry.
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.
Fix some grammar issues and sentence structure problems that we have right now in our README.md file.
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 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.
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 first part, We want to research about a good format for files and also implement the import section of the application(import with files).
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.
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.
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!
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.
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!
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.
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.
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.
when we don't have a mock description, we should display (Without Description) in items in MockArchive. but now we don't...
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 better code style and good architecture, it's better to use FileManager also for NMockLogger.
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.
We want to remove that UI and fix code for sending files only with crashes to the Sentry
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)
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!
At the first, We just wanna replace Google Map SDK and fix functionalities with that.
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:
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...
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 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.
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.
we have a problem with showing the right current location marker position on the map. this happens when we zoom out on the map. and the problem I think is the resource of marker that we use for Neshan SDK.
when we turn back from developer option, we can't open the application and player service I think. we should check and fix that.
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.
Fix relation functionality of position entities in the database at first, and fix update functionalities in the second.
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.
We should fix it and check it to sure that the message sends successfully in the right format to the Sentry.
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)
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.
In order to present the import section in application, we should have a special pattern for creating mock export files.
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.
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...
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.
Implement pusher functionalities and also implement getting user information from the server. connect these together and receive the token that the pusher gave us.
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.
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.
We should listen to the changing state of location, and then when the user turns it on, we must hide the snack bar.
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...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.