-
-
Notifications
You must be signed in to change notification settings - Fork 736
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
Report location provider #348
Conversation
832414c
to
7c71071
Compare
@@ -91,6 +91,11 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { | |||
onCreate(db); | |||
} | |||
|
|||
public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) { | |||
db.execSQL("DROP TABLE IF EXISTS position;"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty nasty to just delete data... :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I stuck with what was done for now when upgrading the schema.
Also, SQLite supports a limited subset of ALTER TABLE (https://www.sqlite.org/lang_altertable.html): there's no easy way to drop a column; and from what I know the idea is to keep the application simple.
At least this prevents the application from crashing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can you downgrade an app?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you meant to say that you have to manually download APK. I don't think very many people do that.
As for the original comment, ideally database should be empty anyway if you have internet connection. Traccar Client uploads data automatically and removes it from local database.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, regular Google Play Store users can't downgrade. But as seen @luke-jr did, so everything can happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for the original comment, I'm also fine with the way upgrading is done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it by copying the apk off another phone that hadn't upgraded yet.
1ffa774
to
312e9cb
Compare
312e9cb
to
ea0b8c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"setting" as a name is pretty ambigous.
Re database changes: I wonder if it would make sense to just build the query string upfront and store that. Then upgrades can just send the old data as-is despite it missing new fields. (And future downgrades would safely send even the new fields!)
ea0b8c9
to
18004aa
Compare
A better name ? |
Database changes, I'll leave that to you. That's a harsh optimization for sure. |
But yes, if the job is only to replay HTTP POSTs, why not just drop Sqlite ? |
"location-source" or something like that maybe? |
@luke-jr no, for "setting". I'd be fine with "tuning", because that's what it does. "complicatedHeuristicName" would be too long. |
721568c
to
252407a
Compare
@tananaev ping ? |
87990cd
to
94e589a
Compare
No description provided.