7778 Commits

Author SHA1 Message Date
MohitMali
c8b98cc504 Using ParcelFileDescriptor instead of FileDescriptor.
* Telling android to not compress the `.zim` files in asset folder while building the apk/bundle.
2023-11-12 18:06:05 +01:00
MohitMali
99614ed88f Introducing reading zim file content through fileDescriptor instead of creating a file to avoid using storage twice for same zim file. 2023-11-12 18:06:05 +01:00
Kelson
ae413559fe
Merge pull request #3525 from kiwix/Issue#3523
Fixed the redundancy of the 'All-Books-Mode' option for Bookmarks, Notes, and History in custom apps.
2023-11-12 18:04:52 +01:00
MohitMali
4c8f7cb02c Fixed the redundancy of the 'All-Books-Mode' option for Bookmarks, Notes, and History in custom apps.
* Since custom apps only have a single zim file, there is no need to display these switches, which can potentially confuse users. Therefore, we have hidden these switches in custom apps.
2023-11-12 18:04:22 +01:00
Kelson
a8eb53f837
Merge pull request #3518 from kiwix/Issue#3515
Fixed, can not open ZIM files from phone storage via the file picker in Android 13.
2023-11-12 18:02:21 +01:00
MohitMali
4baff853fa Fixed, can not open ZIM files from phone storage via the file picker in Android 13.
* Improved the permission request scenario for 'MANAGE_EXTERNAL_STORAGE' in Android 13. In the non-play store variant, we were not prompting users to grant this permission, and they were unaware that it was necessary to access the ZIM files in their storage. To resolve this issue, we now request this permission.
2023-11-12 18:01:28 +01:00
Kelson
f53809abc2
Merge pull request #3218 from kiwix/Issue#2537
Fixed Hosted Books don't update on Application
2023-11-12 18:00:20 +01:00
MohitMali
969ad0d4b1 Increase timeout to check views are displayed or not. 2023-11-11 08:48:22 +01:00
MohitMali
a7b5a7730f Fixed test failure on API level 33.
* In the `ZimHostFragment`, there were occasional test failures due to specific conditions. When reattempting the test, it failed to detect the 'WiFi connection detected' dialog because the server was already running. To resolve this issue, we have improved our test case. Now, we first check if the server is already running. If it is, we close the server before running the test case.
* In previous test failures within the `ZimHostFragment`, there were instances where the zim file was unselected, causing our test case to fail to locate the required views. To mitigate this, we now check whether the zim file is selected. If it's not selected, we first select the zim file before running the test case.
* n the `LocalLibraryFragment` test, there were cases where it was unable to locate the 'file_management_no_files' view due to variations in the order of test cases. This occurred because a zim file was sometimes present in the `LocalLibrary`. To address this, we now check for the presence of any zim files in the `LocalLibrary` and delete them before running our test case.
2023-11-11 08:48:22 +01:00
MohitMali
96b1b195d5 Fixed ZimHostFragment failing on API level 33 (Android 13) because it has the SYSTEM_ALERT_WINDOW permission which is not grantable through code on Android 13, so we have removed this permission from our ZimHostFragment test as well as from our other test cases since we had added this to fix the test cases because without this permission test cases were not launching on API level 21, and now our minimum SDK version is 24 so this permission is no longer needed. 2023-11-11 08:48:22 +01:00
MohitMali
8a4056592e Improved ZimHostFragmentTest.
* We have made improvements to `ZimHostFragmentTest`. We added the `ACCESS_FINE_LOCATION` permission, which is required for running this test case on real devices. Additionally, we have enhanced the permission array and removed unnecessary permissions from the test case.
2023-11-11 08:48:22 +01:00
MohitMali
c3049a6a59 Fixed memory leak on API level 24.
*  When the application goes in the background from `ZimHostFragment`, `KiwixReaderFragment/ZimHostFragment` without starting the Service then the `ReadAloudService`, and `HotspotService` variables are not used and GC try to clear those objects but we are not clearing those objects, that's why memory leak is happening. So now we have free those objects if they are not in use.
2023-11-11 08:48:22 +01:00
MohitMali
3432b32431 Improved ZimHostFragmentTest to properly test the server functionality.
* Created a new class to match the how many checkbox is checked in the recyclerview, it will also help to test this type of functionality in future.
2023-11-11 08:48:22 +01:00
MohitMali
d660d806a2 Added test cases for ZimHostFragment 2023-11-11 08:48:22 +01:00
MohitMali
59e474ed64 Checkbox always visible to user in Wifi Hotspot and user can select and unselect zim files when server already started 2023-11-11 08:48:22 +01:00
MohitMali
b00e335221 Fixed Hosted Books don't update on Application 2023-11-11 08:48:22 +01:00
Kelson
68bfd7737e
Merge pull request #3520 from kiwix/translatewiki
Localisation updates from https://translatewiki.net.
2023-11-11 08:46:54 +01:00
translatewiki.net
3babc62cc0 Localisation updates from https://translatewiki.net. 2023-11-09 13:10:23 +01:00
Kelson
8f099e68db
Merge pull request #3514 from kiwix/Issue#3508
Fixed, the DWDS app is very slow when opening a search result.
2023-10-31 13:30:41 +01:00
MohitMali
99e11d97d9 Saving 'Recent Searches' in the background.
* Previously, we were saving the 'recentSearches' in ObjectBox, and then we were opening the 'searchedPage,' which slowed down the displaying of the results for the user. To address this issue, we are now saving 'recentSearches' in the background, ensuring that it will not impact the end user.
* since we are now directly using the URLs provided by the 'searchSuggestion,' and those URLs are already decoded, our 'URLDecoder.decode()' method will fail to decode URLs containing '%' symbols, as they are already decoded, for example, 'https://kiwix.app/A/FT%.' To resolve this issue, we have modified our 'decodeUrl' extension function to return the same URL if it is already decoded.
2023-10-31 13:29:36 +01:00
MohitMali
8178bbd98f Fixed, unit coverage failure. 2023-10-31 13:29:36 +01:00
MohitMali
0b59d9c586 Fixed, the DWDS app is very slow when opening a search result.
* Now, `libkiwix` provides the `pageUrl` along with the `pageTitle` (searchTitle). Previously, we were not using this `pageUrl` provided by `libkiwix`. Instead, we were making another request for the `pageUrl` based on the `pageTitle`, which was slowing down the process. We have now started directly using the `pageUrl` provided by `libkiwix` during the search. This change has made the process much more efficient and faster.
* To ensure the previously saved searches still work as expected, we have implemented a condition.
* We have added a new column in RecentSearchEntity for saving the `pageUrl` that we will use when user clicks on the recentSearchHistory.
2023-10-31 13:29:36 +01:00
Kelson
89acaf1f01
Merge pull request #3489 from kiwix/translatewiki
Localisation updates from https://translatewiki.net.
2023-10-30 13:13:47 +01:00
translatewiki.net
bf089fdea0 Localisation updates from https://translatewiki.net. 2023-10-30 13:09:52 +01:00
Kelson
8cf8e1baa3
Merge pull request #3497 from kiwix/Issue#1532
Fixed Refactor LocalFileTransfer UI.
2023-10-23 05:04:08 +02:00
MohitMali
bfc0b4af11 Fixing Test Case Failures on API Level 33.
* Resolved the issue where `testShowCase` sometimes hung and failed. The test was failing because it only allowed showcasing a feature once. We improved the test case by clearing the previously shown `ShowCaseView` from its preferences when the test runs.
* Fixed failures in `LanguageFragmentTest` caused by a race condition where the test checked for saved language data immediately, sometimes failing to save the data quickly enough. We added a delay before checking the saved data to address this issue.
* Addressed failures in `DownloadTest` and `InitialDownloadTest` due to issues with previously running downloads. If a download task failed in a previous run, the test couldn't find the download button. In the case of `InitialDownloadTest`, the StorageConfigureDialog was not displayed. We now check for any ongoing downloads before performing new operations and cancel them if necessary, ensuring that the tests run as expected.
2023-10-21 22:03:56 +02:00
MohitMali
350c3ba9b8 Improved testShowCaseFeature which are sometimes failing on the API level 33.
* Increased waiting for checking views are visible or not, on API level 33 sometimes it is taking long to show the views.
2023-10-21 22:03:56 +02:00
MohitMali
2ff2387876 Fixed the memory leak in LocalFileTransferFragment.
* The issue is inside the library, they forgotten to detach the view after its successful use, means when the showCase is shown they are not detaching the view from window which causing the memory leak. They have not mentioned this step into their documentation to address the memory leak.
2023-10-21 22:03:56 +02:00
MohitMali
5e2c314f74 Added test cases to comprehensively assess the ShowCaseView functionality.
* Ensured that the showcase view is displayed in full only once, and subsequent displays are prevented.
* Improved variable naming for clarity.
* Fixed TopLevelDestinationTest.
2023-10-21 22:03:56 +02:00
MohitMali
76b6f5c7c6 Fixed TopLevelDestinationTest 2023-10-21 22:03:56 +02:00
MohitMali
a8b41f5b15 Introduce 'MaterialShowCase' feature to provide user education on the file transfer functionality. 2023-10-21 22:03:56 +02:00
MohitMali
c81ae5d730 Fixed Refactor LocalFileTransfer UI.
* Reduced the `view_device_list_boundary` height to match the one below it, resulting in a more consistent appearance.
* Enhanced the permission request scenario; previously, permissions were requested one by one when the user clicked on the search button. Now, we request all necessary permissions at once to improve the user experience.
2023-10-21 22:03:56 +02:00
Kelson
ce45eba5c4
Merge pull request #3510 from kiwix/Issue#3509
Updated the asset folder naming
2023-10-21 10:08:42 +02:00
Gouri Panda
a2f2bee81f Updated the asset folder naming 2023-10-21 13:15:59 +05:30
Kelson
981b4e67c7
Merge pull request #3506 from kiwix/Issue#3505
Fixed, Unable to upload APK on play store for new apps.
2023-10-20 12:55:26 +02:00
MohitMali
338d64efa7 Refactored the code to make the 'Play Asset Delivery' process generic.
* Renamed the module to 'install_time_asset' to make it generic for every custom app.
2023-10-20 16:16:34 +05:30
MohitMali
724f4a7ff4 Enhanced zim file loading functionality.
* We have corrected the order of obtaining ZIM files, specifically for the DWDS application. In this application, we retrieve the ZIM file from the asset folder, and there is no ZIM file inside the obb/files directory. This adjustment addresses an issue where a temporary file was mistakenly added to the files directory, causing the application to return an invalid file. By changing this order, it does not impact previous apps, as they do not have the ZIM file in the asset folder, allowing them to skip this part and function normally.
2023-10-20 14:41:35 +05:30
MohitMali
69ce81c175 Enhanced asset loading.
* Assets were always copied, even if they were already present in storage. This resulted in slow startup times, as the files were copied on each run. We now only write assets to a file when no file exists or corrupted.
2023-10-20 12:32:56 +05:30
Gouri Panda
e32ba6d70b Bundle order issue fixed 2023-10-20 02:03:51 +05:30
MohitMali
1d39d35d98 Added build task to sync the changes.
* In our 'publishingBundle' task, we are sequentially executing the 'downloading' and 'buildingBundle' tasks. Since we dynamically download and place the ZIM file, Gradle does not initially recognize any new files added to the asset folder. As a result, these files are not included in our bundle. Now, after downloading and placing the ZIM file in the asset folder, we synchronize our changes, allowing Gradle to detect the addition of new files.
2023-10-19 16:03:56 +05:30
MohitMali
725a5ccd0b Added overrided version code suffix 2023-10-17 15:36:10 +05:30
MohitMali
53d4ac1847 Fixed version code not found exception while publishing bundle on play store 2023-10-17 15:13:09 +05:30
MohitMali
71f851821a Fixed, uploadBundle method to properly upload bundle on play console instead of APKs 2023-10-17 14:38:20 +05:30
MohitMali
1b87900695 Fixed zim file not found when we try to retrieve it from Play asset delivery to our application.
* We are now storing the zim file name in buildConfig file which we will use when we try to retrieve it later.
* Improved downloading functionality.
2023-10-17 12:28:42 +05:30
MohitMali
4c951de69e Fixed, Unable to upload APK on play store for new apps.
* We have implemented Play Asset Delivery to include the ZIM file within the Android App Bundle (AAB).
* To achieve this, we've created Gradle tasks to automatically download the ZIM file and place it inside the assets folder.
* In order to utilize this asset file, we've refactored our custom application code.
* We haven't removed the functionality of uploading the APK, as this approach remains static for now. Thus, we are retaining both codebases.
2023-10-17 11:07:45 +05:30
Kelson
3a47ae601a
Merge pull request #3503 from kiwix/header_issue_in_custom_application
Fixed URLConnection not adding headers to the request.
2023-10-16 16:28:30 +02:00
MohitMali
7460b9d6e5 Fixed, Code formatting issue 2023-10-16 12:58:59 +05:30
Gouri Panda
c4405ab6d1 Fixed language bundle issue for the playstore 2023-10-14 12:48:02 +02:00
Gouri Panda
12c6f5ec79 Reverting fixed language bundle issue for the playstore 2023-10-14 12:48:02 +02:00
Gouri Panda
033d11679e Fixed language bundle issue for the playstore 2023-10-14 12:48:02 +02:00