2769 Commits

Author SHA1 Message Date
MohitMali
edbdeff7d7 Removed the unnecessary wrapper classes of libkiwix from the codebase since we don't need these classes as saving/deleting functionality will be tested in java-libkiwix.
* Added instrumentation test case for testing the UI part with libkiwix bookmark functionality.
2023-11-16 12:45:56 +05:30
MohitMaliFtechiz
967e2df093 Introducing the writeFile method of the Library class allows us to save the library, which contains information about books, their file paths, and favicons, into a file.
* We now save this library information into a file named `library.txt` and subsequently read from it to retrieve file paths and favicons.
* The test cases have been refactored to accommodate this new functionality.
* The `ObjectBoxToLibkiwiMigrator` code has also been enhanced. With this change, we now save books in the library for their favicon and zimFilePath, resulting in a refactor and improvement of this class's functionality and its associated test cases.
* The process of writing bookmarks and library data to file has been enhanced. Now, this is performed asynchronously in a background thread to mitigate potential data loss.
* Additionally, several other improvements have been made throughout the codebase.
2023-11-16 12:45:43 +05:30
MohitMali
f43a6a835e Improved LibkiwixBookTest and added new ObjectBoxToLibkiwixMigratorTest cases 2023-11-16 12:45:31 +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
MohitMali
6e0336ebf7 Using newly published 'libkiwix 1.0.0' from maven 2023-09-18 19:13:20 +02:00
MohitMali
75fab0635e Refactored search functionality according to the new wrapper 2023-09-18 19:13:20 +02:00
MohitMaliFtechiz
e69499fa03 Removed the relinker dependency from the project, since now we are loading the .so files on the libkiwix side. Enabled the loadICUData method, since now it is fixed on the libkiwix side. Search and server is now starting successfully, but need some refactoring, for that see next commit. 2023-09-18 19:13:20 +02:00
MohitMali
161337a818 Start using libkiwix 11.0.0 from maven, loading wrappers .so files for fixing the jni crash which we have missed loading in libkiwix 2023-09-18 19:13:20 +02:00
MohitMali
d62d43957e Refactored the code to support the java-libkiwix 11.0.0 2023-09-18 19:13:20 +02:00
translatewiki.net
f29c206729 Localisation updates from https://translatewiki.net. 2023-09-18 13:08:06 +02:00
MohitMali
f029498e84 Added SYSTEM_ALERT_WINDOW permission for api level 21 as by default it is not launching the activity and giving error Could not launch intent Intent this error comes when we have not Display pop-up windows while running in the background permission 2023-08-31 19:18:44 +08:00
MohitMali
efc3dbffba Fixed Bookmark toggle is not ON for saved bookmarks 2023-08-31 19:18:44 +08:00
MohitMali
8fee2d119a Enhanced FileSystem Check.
* Added `tmpfs` filesystem to `support 4GB filesystem list` since this type supports writing files over 4GB.
* Updated the name of the writing test result file to `kiwix_4gb_writing_test_result` to enhance readability.
2023-08-29 18:35:15 +05:30
translatewiki.net
64a2bba45d Localisation updates from https://translatewiki.net. 2023-08-24 13:10:10 +02:00
MohitMali
64c3c041f6 Added test case for testing the pause/resume functionality 2023-08-01 12:15:17 +05:30
MohitMali
0a2cff92b5 Introduced pause/resume functionality.
* Added pause/resume button beside the stop button to perform pause/resume action on the downloading zim file.
* Handling pause/resume via fetch library.
2023-07-31 13:50:23 +05:30
MohitMali
6e195fc42f Fixed the UnsafeCallOnNullableType detekt issue in the project. 2023-07-18 22:42:54 +02:00