2782 Commits

Author SHA1 Message Date
MohitMaliFtechiz
50eeddd314 Fixed: The chooser UI now defaults to displaying external storage.
* Previously, it displayed the last known location when selecting a folder for external storage, which could confuse the user. We have now resolved this by defaulting to opening the SD card when choosing the SD card folder.
2023-12-19 19:38:32 +05:30
MohitMaliFtechiz
dcc8a40751 Increased timeout for waiting the views in ZimHostFragmentTest since on Android 13 it takes time to find the views. 2023-12-15 19:09:22 +05:30
MohitMaliFtechiz
b572d02e6c Fixed HelpFragmentTest and PlayStoreRestrictionTest on api level 24 2023-12-14 15:03:01 +01:00
MohitMaliFtechiz
90dc8ec292 Enhanced the visibility of the ZIM file on the help screen for testability.
* Introduced test cases for the new functionality to ensure its expected behavior in both variants, such as Play Store and non-Play Store.
* Updated other test cases to accommodate the testing of this new functionality.
2023-12-14 15:03:01 +01:00
MohitMaliFtechiz
c20b40e389 Added a button to the startup message dialog to directly open the Kiwix website for downloading the APK. This will make it easier for the user who wants to download the full APK version of the Kiwix app. 2023-12-14 15:03:01 +01:00
MohitMaliFtechiz
c3a6a52255 Added play store restriction dialog 2023-12-14 15:03:01 +01:00
MohitMaliFtechiz
7d276658d4 Fixed Start-up message to inform about the restrictions on the Google Store app to open sideloaded ZIM files.
* Showing play store restriction to the users in the help screen in play store variant.
2023-12-14 15:03:01 +01:00
MohitMaliFtechiz
1b6be45826 Fixed LocalLibraryTest that was failing. 2023-12-14 07:51:52 +01:00
MohitMaliFtechiz
736d95285d Fixed unable to open zim files on sd card in version 3.8.1
* If the ManageExternalStorage permission has not been granted, introduce the request, particularly when accessing features that necessitate this permission, such as downloading ZIM files, selecting a ZIM file from storage via the file picker, and refreshing the list of available ZIM files in storage.
2023-12-14 07:51:52 +01:00
translatewiki.net
e2585529d2 Localisation updates from https://translatewiki.net. 2023-12-01 21:05:15 +01:00
MohitMaliFtechiz
04868ecfdd Fixed: Numerous issues with links were reported by the Play Store.
* The Play Store highlighted the need to add "/" to the beginning of the `android:pathPattern`. As a result, we have now included "/" at the beginning of all `android:pathPattern` instances to ensure compatibility with the Play Store.
* Additionally, the `android:autoVerify="true"` attribute has been added to intent filters to verify domain ownership. This was identified as an issue by both the Play Store and the App Links Assistant tool in Android Studio.
2023-11-25 10:14:53 +01:00
MohitMaliFtechiz
46b51bb710 Fixed, Bookmark toggle is not on when opening bookmarks for existing opened book.
* Fixed the issue by correctly setting up the bookmark disposable for the current ZIM file when opening bookmarks for the currently opened book.
2023-11-22 11:30:42 +05:30
MohitMaliFtechiz
52fefe7df7 Moved version-related properties from individual build.gradle files to a common configuration file (Config.kt).
* The `Config.kt` now holds the version information we can directly change the versionCode here and it will automatically replace in both gradle files.
* Removed duplicate version configurations from build.gradle files.
2023-11-21 12:44:37 +05:30
MohitMali
748f0c4d5f Moved openSearchItem, findInPage functionality to our CoreReaderFragment as we were using same code twice for these methods in app and custom module. 2023-11-16 19:10:02 +05:30
MohitMali
088f28d1d6 Fixed MimeTypeTest. 2023-11-16 18:16:35 +05:30
MohitMali
f6b01a4f28 Fixed, I can't open Zim from an external download.
* We are now using fileDescriptor to open the zim files with uris when someone tries to open the zim file directly from storage.
* As now we are using the assetFileDescriptor instead of direct files, we have refactored the functionality of saving (note, history, bookmark) so that we can open the same pages on the same zimFile.
2023-11-16 18:10:53 +05:30
MohitMali
ae0893095c Fixed MimeTypeTest compilation error 2023-11-12 18:06:05 +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
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
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
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
translatewiki.net
bf089fdea0 Localisation updates from https://translatewiki.net. 2023-10-30 13:09:52 +01: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
MohitMali
41be43d292 Fixed ZimHostFragment Open Issue for Both App and Custom Modules.
* We moved our server functionality to the core module to enable its use in both our app and custom modules. However, this change posed a challenge. We had a functionality that, when the user clicks on a notification, it takes them to the hosted book screen. By moving this functionality to the core module, we lost direct access to the navigation graph and `KiwixMainActivity` or `CustomMainActivity`.
* To address this issue, we introduced some abstract variables, such as navGraphId and mainActivity, which we set from both `KiwixMainActivity` and `CustomMainActivity`. This allows us to retrieve the navigation graph ID and the main activity.
* Additionally, we implemented a new function in `CoreApp` to set the currently running `CoreMainActivity`, which we use to obtain the navigation graph ID and main activity to perform the user click on notification.
2023-10-14 09:59:39 +02:00
MohitMali
94d592f545 Reintroduce wifi hotspot feature in custom apps.
* Moved wifi hotspot related files to core module to use hotspot functionality in both app and custom module.
* Moved permission in core manifest to access them in both modules.
* Removed some unnecessary files which is now no longer in use.
2023-10-14 09:59:39 +02:00
MohitMali
5e9f183f6a Fixed, unable to open the support link with default browser.
* Fixed, pdf are not opening with default pdf viewer.
* Fixed, sending email are failed with default email service.
* Fixed, opening support link, external urls with default browser.
2023-10-13 18:45:12 +05:30
MohitMali
530faa46bb added a test case to evaluate the functionality of LocalFileTransferFragment.
* This test case is designed to verify that the functionality works correctly, especially addressing the issue where `LocalFileTransferFragment` would shut down when attempting to search nearby devices for connection.
2023-10-05 08:14:04 +02:00
MohitMali
e4d27e19a1 Improved code for android 13. 2023-10-05 08:14:04 +02:00
MohitMali
57a95f15d1 Fixed, The File transfer feature does not work in android 12, android 13.
* In Android 13, we previously used `intent.getParcelableArrayExtra` to retrieve the status of `P2P_DEVICE_CHANGED`. However, this method returned null because it's not actually an array. To resolve this issue, we have updated it to use `intent.getParcelableExtra`.
* For Android 12, we used to check the network state through `ConnectivityManager` every time the `WIFI_P2P_CONNECTION_CHANGED_ACTION` action was triggered. However, this approach wasn't reliable, as the action being triggered didn't guarantee a change in the network state. Instead, it sends an intent that we should now check for network changes. As a result, we have modified our code to utilize this intent within the `KiwixWifiP2pBroadcastReceiver`.
2023-10-05 08:14:04 +02:00
MohitMali
e4624b238b Handled download on the first run when no ZIM file is found.
* We are showing a custom error message to the user for this type authentication urls because we does not have any authentication values in our application so it will always fail to download the zim file, so we are showing a error message where we inform to user to reinstall application from the playstore. Since play store application have the zim file in it.
2023-10-04 19:17:12 +02:00
MohitMaliFtechiz
221f84b2bf Improved the "load more" functionality for search and introduced several other enhancements:
* Added logging for cases where the `ZimFileReader` failed to find an entry, failed to load an asset, and more.
* Significantly improved the "load more" functionality: Now, if the user is near the end of the list, we start loading new search results. This enhancement enhances the user experience by reducing wait times for new search results.
* Added references in the `KiwixServer` class to help developers understand why we are keeping the library object.
* Implemented test cases to thoroughly test the `getMimeTypeFromUrl()` function in the ZimFileReader class.
* Enhanced the search functionality by consolidating the use of a single viewModelScope instead of multiple coroutines, reducing the potential for future issues.
2023-09-18 19:13:20 +02:00
MohitMali
1281c0c795 Improved test cases and fixed memory leak in application.
* Previously our test cases were launching the `KiwixMainActivity` twice (firstly it sets the values in preference and then relaunch the activity) before running the test case which was the cause of slow testing and sometimes it caused to memory leak in some api levels so we have refactored our test cases to launch `KiwixMainTest` once per test case.
* `IntroFragmentTest` is failing on api level 24 due to a memory leak because after clicking on getStarted button is going to the LocalLibrary page but somehow `onStart` and `onStop` methods are calling of the `CoreReaderFragment` which stablish the `serviceConnection` but it was happening very quickly so before attaching the binder to `readAloudService` unbindService method called but at this point service was not created but creating was in progress so after going to library screen it allocate memory to `readAloudService` but `ReaderFragment` is no more visible to the user that's why memory leak happened. We have fixed it by unbinding the service in `onDestroyView` method.
2023-09-18 19:13:20 +02:00
MohitMali
ad81bbdcf0 Fixed server crashing issue when we open it on web browser 2023-09-18 19:13:20 +02:00
MohitMali
4f2b54e70a Improved SearchFragmentTest:
After addressing the issue documented in https://github.com/kiwix/java-libkiwix/pull/61, we now have the ability to search within zim files that do not have a Xapian index. As a result, we have enhanced our test to utilize pre-existing zim files. This improvement leads to reduced time consumption, improved memory efficiency, and minimized network usage impact.
2023-09-18 19:13:20 +02:00
MohitMali
ed237a4d78 Keep everything in libkiwix/libzim in release variant.
* Updated proguard file to keep the `libkiwix/libzim` classes in release variant.
2023-09-18 19:13:20 +02:00
MohitMali
69982e9db8 Fixed ZimMangeViewModelTest 2023-09-18 19:13:20 +02:00
MohitMali
632bb4a528 Refactored code to remove lint errors
* Now our minimum SDK version is 24 and we are using some conditions placed on behalf of this api level which are unused now, so we have removed those conditions.
* Removed `CompatV21` file as now it is unused.
* Renamed `CompatV23` to `CompatV24` and refactored the code to support our new minimum api level.
* Refactored `NetworkUtilsTest` to support api level 24.
2023-09-18 19:13:20 +02:00
MohitMali
f7517a2272 Minimum SDK version changed to 24: The NDK version in kiwix-build has been upgraded (as mentioned in https://github.com/kiwix/kiwix-build/issues/544). However, to make this upgrade compatible, the minimum SDK version had to be updated to 24 since the NDK version is not compatible with Android API levels below 24. The README.md file has been updated to reflect the new minimum Android support version, which is now Android 7, due to the change in the minimum SDK version. Since the project's minimum SDK version is now 24, some conditions related to Android 23 and 24 have become unused. These unused conditions have been removed, and along with that, the drawable-night-23 and drawable-23 launch_screen.xml files, which were no longer in use, have also been removed. 2023-09-18 19:13:20 +02:00
MohitMali
46d4aeb505 Refactored SearchFragmentTest
* As we can not search in that zim file which is not contains the FT Xapian index and testzim.zim file is not contain it so we have improved our test case.
* Now we are downloading the `off the grid` zim file and performing the search functionality inside it.
2023-09-18 19:13:20 +02:00
MohitMali
02a6d0f83f Fix the instrumentation test cases 2023-09-18 19:13:20 +02:00