1233 Commits

Author SHA1 Message Date
Peter Serwylo
4e24050760 Adding our own cache of currently installed apks in the database.
Previously the data was not stored anywhere, and each time we wanted
to know about all installed apps, we built a ridiculously long SQL
query. The query had essentially one "OR" clause for each installed
app. To make matters worse, it also required one parameter for each
of these, so we could bind the installed app name to a "?" in the query.
SQL has a limit of (usually) 999 parameters which can be provided to
a query, which meant it would fall over if the user had more than
1000 apps installed.

This change introduces a new table called "fdroid_installedApps".
It is initialized on first run, by iterating over the installed apps
as given by the PackageManager. It is subsequenty kept up to date
by a set of BroadcastReceivers, which listen for apps being
uninstalled/installed/upgraded.

It also includes tests to verify that queries of installed apps,
when there are more than 1000 apps installed, don't break.

Finally, tests are also now able to to insert into providers other
than the one under test. This is due to the fact that the providers
often join onto tables managed by other providers.
db-version/43
2014-04-20 16:50:22 +09:30
Daniel Martí
655f2bf7e3 Update UIL 2014-04-17 01:20:42 +02:00
Daniel Martí
57eaad7c1b Remove RelativeLayout leftovers 2014-04-17 01:20:32 +02:00
Peter Serwylo
de085f7e02 Added ApkProvider.get() to return a single apk.
This allows you to specify the Uri of a single apk, and
it will return it. Right now it is just used in a test, but
hopefully it will be useful in other situations too.
I forgot to commit this last time, and didn't review my patch
well enough before submitting.
2014-04-12 19:02:15 +00:00
Peter Serwylo
8c6ce67100 Added test for "ApkProvider.delete(..., List<Apk>)"
This was explicitly not-allowed previously, and so there was a
test that ensured it threw an exception when attempted on the
ApkProvider. However I implemented it for another feature, but
forgot to change the tests. Now the test no longer tests for
an exception. Rather, it properly tests for the correct execution
of the method.
2014-04-12 09:25:26 +00:00
Peter Serwylo
60f2be678a Merge branch 'master' into 'master'
run JUnit tests

It turns out that Jenkins was running the JUnit tests all along, but it just never reported on them.  This adds a jar to the test project that makes JUnit reports that Jenkins can parse, and the report on the results.  So now if the JUnit tests fail, people will be emailed just like build failures.

Also, I added a quick `ant javadoc` target to the main project in case anyone likes that kind of thing.
2014-04-11 21:56:39 +00:00
Hans-Christoph Steiner
d813f1ec17 run JUnit tests using android-junit-report to get XML output
Jenkins needs some kind of report from the JUnit tests in order to tell
whether the tests succeeded or not.  android-junit-report is a library to do
exactly that.  With this setup, Jenkins should now successfully understand the
status of the JUnit tests, where before it just ran them and ignored the
results
2014-04-11 14:10:26 -04:00
Hans-Christoph Steiner
bc6f3d5cd9 add ant javadoc to generate javadoc for FDroid sources 2014-04-11 14:10:25 -04:00
Daniel Martí
4db53deb42 Forgot to set the icon sizes back to normal
They got added +8 since we added paddings directly to the icon layout. Since
those paddings got removed, this has to be switched back too.
2014-04-11 19:24:46 +02:00
Daniel Martí
8ed76f47ee More improvements to the app list layout
* Don't use a RelativeLayout for the whole thing
* Use more external paddings, not per-element paddings
* Center everything vertically
2014-04-10 16:33:15 +02:00
Daniel Martí
e7f76705c8 Move "receiver" and "address" into UpdateService.EXTRA_... 2014-04-10 15:56:10 +02:00
Daniel Martí
f6707490f8 Move "from" into AppDetails.EXTRA_FROM 2014-04-10 15:52:11 +02:00
Daniel Martí
7fd3ea236e Move "appid" into AppDetails.EXTRA_APPID 2014-04-10 15:49:02 +02:00
Daniel Martí
2cdb634865 Fixes #6: Spaces before ellipsis in German are OK 2014-04-10 15:23:19 +02:00
Daniel Martí
40d873551f A bit of extra cursor safety, avoid the last missing .close() 2014-04-10 15:11:00 +02:00
Daniel Martí
f04ac83ec9 Fix build without java 1.7 compatibility 2014-04-10 15:08:29 +02:00
Peter Serwylo
fe1806b016 Merge branch 'misc_fixes' into 'master'
Localized category list
2014-04-10 03:51:58 +00:00
Peter Serwylo
2a296c0302 Merge branch 'master' into 'master'
Scroll to top on category change

Scroll to the top of the available app list when changing categories.
See: https://gitlab.com/fdroid/fdroidclient/issues/7
2014-04-10 03:46:58 +00:00
James Clark
09ccf3d428 Fix bug introduced in last commit 2014-04-10 04:14:55 +01:00
James Clark
87638363b3 Set listview to top item after category refresh 2014-04-10 03:45:17 +01:00
Peter Serwylo
d54dc0b7bb Merge branch 'master' into 'master'
fix two bugs

First bug is with lots of QR Code readers, they don't respect custom URI schemes like `fdroidrepo://` and just force all URIs to be `http://`.  A slight tweak makes it possible to use a QRCode to configure a repo using all of the major ones I could find (I tested with 8 different apps).

The second bug is a simple crasher bug.
2014-04-08 06:51:16 +00:00
Hans-Christoph Steiner
da329089fb add custom ant rules for downloading JUnit results 2014-04-08 00:16:03 -04:00
Hans-Christoph Steiner
c1d0ec43c3 fix crasher when hopping around apps and adding repos
I triggered this a few times while trying various QR Code scanning apps
with FDroid.

fixes #3222 https://dev.guardianproject.info/issues/3222
2014-04-07 21:39:50 -04:00
Hans-Christoph Steiner
407e7662e9 support QR scanners that do not respect custom URI schemes
Some QR Code scanners don't respect custom schemes like fdroidrepo://, so
this is a workaround, since the local repo URI is all uppercase in the QR
Code for sending the local repo to another device.  This way, the QR Code
can still be all uppercase and use HTTP:// and Android will still route it
to FDroid, but via the Just Once/Always chooser (fdroidrepo:// goes
directly to FDroid with no prompt, when it works)
2014-04-07 21:07:01 -04:00
Daniel Martí
a477f421cb Greatly improve app list layout
* Don't hard-code ellipsis in the code
* Separate the two rows into two linear layouts
* Don't abuse relative layouts
* Use ellipsize with weights to achieve best results
2014-04-07 19:35:04 +02:00
Daniel Martí
b731ab57b3 Release 0.63 0.63 2014-04-07 15:46:33 +02:00
Daniel Martí
ad9218d14c Fix some string formats and an ellipsis 2014-04-07 15:21:23 +02:00
F-Droid Translatebot
c717d919af Translation updates 2014-04-07 14:16:49 +01:00
Daniel Martí
34d7172ad6 Bump support lib from 19.0 to 19.1 2014-04-06 11:03:14 +02:00
Daniel Martí
d16c7fc95a Merge branch 'fix/multi-repo-updating-only-one-repo' into 'master'
Fix Multi Repo Updating Only One Repo

Java update logic has been moved to SQL, to prevent having to pull out apps fromt he database, and then iterate over them in Java.
2014-04-06 09:03:12 +00:00
Peter Serwylo
dcf3a9dae8 Fixed assumption that repo updates have all apps available.
Previously, I accidentally made the repo updater presume that it
had access to all apps in a big fat list. This meant that I was iterating
over that list, performing calculations, etc, rather than actually
querying the entire database.

The solution was to bundled all update-service related processing to one
process in AppProvider (I didn't want to have to pull every single app/apk
out of the database in order to perform the update, because that will become
more and more burdensom as the repo grows).

There is a method calcDetailsFromIndex() in the AppProvider.Helper class.
It now does three things:
 * updates compatibility flag.
 * updates suggested version (outstanding issue is documented in gitlab issue #1)
 * updates iconsUrl (fixed in this commit)

Icons from old repos will just have icons in an "icons" dir
in the same folder as the index.jar. New repos have density
specific icon dirs (e.g. "icons-240") which depend on the
device F-Droid is running on.
2014-04-06 12:34:47 +00:00
AlexanderR
04ea93cce8 Category list i18n 2014-04-05 17:08:29 +11:00
AlexanderR
c1daa99617 Use managedQuery to let Search Activity automatically dispose of it's Cursor.
Should be somehow done via Loaders someday.
2014-04-05 10:32:58 +11:00
AlexanderR
793bd618ac Fixed weird crash on emulator 2014-04-04 18:06:03 +11:00
F-Droid Translatebot
628d684ab9 Translation updates 2014-04-03 20:57:36 +01:00
Peter Serwylo
eded748ab8 Fixed the suggestedVersion calculation, now done via SQL.
The archive repo was getting updated after the regular repo.
In these situations, we didn't have every single app/apk in
memory in order to calculate the suggested version. As a
result, F-Droid ended up choosing a suggested version from
the archived versions, when terhere was actually a newer version
in the database.

This change does all of the calculations in two database queries
now. Although the implementation of the query is not hackey,
they way I get to the code in order to execute the query
is a bit hacky, so most of the implementation is private.
2014-04-03 00:32:56 +11:00
Peter Serwylo
e7eb3120cf Updated changelogs with (what is hopefully) a lay description of the ContentProvider changes. 2014-04-02 22:38:49 +11:00
Daniel Martí
8977ac6826 Prepare the changelog 0.62 2014-04-01 16:09:16 +02:00
Daniel Martí
f6cf7c9b0c Revert "Use a commit hash instead of 0.62 to test if repo works"
This reverts commit f0a40d8b6e1f165b75444353c8aac60c39c8ac68.
2014-04-01 16:06:01 +02:00
Daniel Martí
f0a40d8b6e Use a commit hash instead of 0.62 to test if repo works 2014-04-01 15:19:14 +02:00
Daniel Martí
edd2de49c3 Use HEAD instead of LAST_STABLE_TAG 2014-04-01 15:16:24 +02:00
Daniel Martí
232145eac1 Update repo snippet to latest version 2014-04-01 15:09:35 +02:00
Daniel Martí
44312bdb6c Bump version to 0.62 2014-04-01 14:40:27 +02:00
Daniel Martí
2ff0ae9550 Run translation scripts 2014-04-01 14:04:32 +02:00
Daniel Martí
6b08ab0e97 Place -hu arrays in the correct file 2014-04-01 14:02:26 +02:00
F-Droid Translatebot
4f0cba0c84 Translation updates 2014-04-01 12:16:44 +01:00
Ciaran Gultnieks
ce334e215d Add Hungarian translations by gidano 2014-04-01 11:57:10 +01:00
Peter Serwylo
5e0af1dc5b Merge branch 'feature/implement-app-removal-by-index' 2014-04-01 21:26:01 +11:00
Peter Serwylo
468b6717ee After downloading index, remove apks no longer in the index.
It adds an extra 600ms on my Nexus 4 with ~2000 apks from the
F-Droid index. But I think it is the only way, as we really need
to iterate over every single installed apk, to see if it is still
wanted. The up side is that we can query for a large amount of
them, rather than quering individually for each apk.

NOTE: I haven't added a new status message yet, because we are
about to do a stable release. After the stable release, I'll
add a new status message to cover for this > half a second
(on my relatively fast device). This will probably be part of
an overhaul of the update process in general, including a
proper progress dialog.
2014-04-01 21:19:27 +11:00
Daniel Martí
05d8e409c4 Remove TODO-before-release 2014-03-28 18:48:08 +01:00