-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug of update of database to version 5 #49
Conversation
Hi Andrej, your pull request seems to lack some change, it only contains a new exception thrown (?) Instead of throwing an exception at that point, which crashes the App just the same way as without that check, there should be a better way. Also, I don't get how db==null could happen there, can you elaborate a bit on this? Thanks! |
Hi Michael, Thanks for responce. I am beginner in GitHub and this is my first pull. Now I see, someone read my pull and I can continue my researching of your code if you interested. About my work. I have added the 24 hour logged path of the vehicle into Google map. User can see a track of his vehicle for last 24 hours. Also he can see the speed and other values for each location of the car for last 24 hours. Are you interested in my work? Many bugs was fixed also. Thanks! |
I have excluded db==null exception during updating database to version 5. Before db==null, because database not yet opened during updating database to version 5. See call stack: Thread [<1> main] (Suspended (breakpoint at line 540 in Database)) <VM does not provide monitor information> Database.addNotificationInt(NotificationData) line: 540 Database.onUpgrade(SQLiteDatabase, int, int) line: 172 Database(SQLiteOpenHelper).getDatabaseLocked(boolean) line: 257 Database(SQLiteOpenHelper).getWritableDatabase() line: 164 Database.open() line: 37 Database.getlatlngdetail(int, int) line: 285 MainActivity.updatelocation() line: 423 MainActivity.onCreate(Bundle) line: 65 MainActivity(Activity).performCreate(Bundle) line: 5231 Instrumentation.callActivityOnCreate(Activity, Bundle) line: 1087 ActivityThread.performLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 2159 ActivityThread.handleLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 2245 ActivityThread.access$800(ActivityThread, ActivityThread$ActivityClientRecord, Intent) line: 135 ActivityThread$H.handleMessage(Message) line: 1196 ActivityThread$H(Handler).dispatchMessage(Message) line: 102 Looper.loop() line: 136 ActivityThread.main(String[]) line: 5017 Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method] Method.invoke(Object, Object...) line: 515 ZygoteInit$MethodAndArgsCaller.run() line: 779 ZygoteInit.main(String[]) line: 595 NativeStart.main(String[]) line: not available [native method] Instead I am updating another instance of database, opened in the Database(SQLiteOpenHelper).getDatabaseLocked(boolean) function.
See my new "bug of update of database to version 5" Commit on Apr 14, 2015 |
Hi Andrej, bug and solution are now clear, thanks! Your solution of an add...() with explicit db parameter is good. A writable db is delivered to onUpdate() and needs to be used within the update procedure. Another solution would be to do "this.db = db;" in onUpdate(), but your solution is better, I'll merge that later on. For your GPS track display, that would be really neat and has already been asked for by other users. Did you base your work on my GPSLogData storage class? That would be perfect as that's intended to be shared between the power history display and the track display. The track display also can use the power/energy info to create a nice energy heatmap like explained in the GPS visualization howto, and the GPSLogData class already contains load/save functions to be able to store some tracks for later comparisons. Thanks & regards, |
Forgot: there is no real db downgrade procedure, you can only set the version tag to let the onUpgrade() be run again. To do so, set the SCHEMA_VERSION to the lower version, launch once, then raise the version again and launch again. The onUpgrade() should be called again and needs to be able to handle already existing upgrade structs. |
bug of update of database to version 5
Andrej, would you mind joining the OVMS developer mailing list? |
I have joined. Thanks. Вторник, 14 апреля 2015, 10:14 -07:00 от Michael Balzer [email protected]:
|
I did not develop the server side of the OVMS project. Another guy - Lee Howard [email protected] wrote it. Attached is the patch for the perl code which is made to the server to support the logged path. We have added new command: documentation for "Retrieve 24-hour log data" should read:33 - Retrieve 24-hour log data
* data record valueThe "code" can be any of those described on pages 10 through 23,
|
If someone wants to set this patch up as a pull request for the main ovms_server.pl, I'd be happy to bring it in. |
That's a useful server extension. I'll have a look if we can extend the L records by the power data, so we can produce some heatmap from those records as well. For the options menu, please have a look at my latest changes -- I replaced those text switching menus by standard checkbox items. |
Hello, Do you saw: Can you comment this? Andrej Понедельник, 13 апреля 2015, 23:54 -07:00 от Michael Balzer [email protected]:
|
No description provided.