-
-
Notifications
You must be signed in to change notification settings - Fork 448
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
GSoC 2019 Deliverable: Local File Transfer #1276
Conversation
The activity can now be used to send one selected ZIM file to a nearby device (Cleanup and refactoring yet to be done)
Instead of using a service, so that the progress can be visually displayed
- During handshake, sender device informs the receiver of: 1) Total no. of files 2) Name of files to be sent - The file name is now being used instead of "temp.zim" to save the received file in the 'KiwixWifi' directory
All selected files (not just the first one) are trasferred to the receiving device
- File receiver device can not initiate connection anymore - Activity closes on both devices once transfer is complete
… folder Location obtained from the SharedPreferenceUtil
…alFileTransferActivity
White icon tint was corrected in the commit before the previous one
Instead of the general 'Wireless' settings page, incase the wifi hasn't been turned on for file transfer
…transferred Next step - Use this list to display progress of transfer
Fields: File name and transfer status (to be sent, sending, sent)
3 possible states: To be sent (wait icon) -> sending (progress bar) -> sent (check icon)
Best guess - Calling disconnect after sending the last file was somehow corrupting the output stream to the server. Replacing with Toast (or just finish()) has corrected it.
- Separate device disconnection to separate method - Override back button
For disconnecting a connection to an erroneous peer device
Device name for WiFi Direct is supposed to be changed manually (from the advanced wifi settings) by the user. This solution used reflection to access the hidden method used by the system to perform the same. However use of non-SDK interfaces (fields/methods accessed using reflection) will be restricted and subsequently lead to exceptions, hence the feature needs to be removed. For more: developer.android.com/distribute/best-practices/develop/restrictions-non-sdk-interfaces
Unnecessary comments, todos, variables, imports, methods
- Add title to activity - Divide screen space between list of available peers and files for transfer
Comprehensive refactoring of DeviceListFragment, includes: - Shifting all async-tasks to separate files - Exceptions in the async-tasks are now handled by showing a toast and closing the LocalFileTransferActivity - Added a new 'Error' status for file items - If a file has error status after transfer, then an error icon is shown for it TransferProgressFragment - Documentation and other additions/changes
Functionality has already been replaced by the SenderDeviceAsyncTask
Wasn't ignoring some .idea files
The 'Get zim from nearby device' option now only shows in 'Device' tab of library
Keeping with the I in SOLID, WDM now uses a plain Activity instead of LocalFileTransferActivity specifically
Removed extra methods + refactor
I have restricted it to the 'Device' tab as suggested
I merged develop into the branch
If it feels non-intuitive to send from the 'share' option in the contextual menu, maybe I should create a separate point of entry for the whole module? I was thinking of something like this with the nav-drawer UI (like a separate nav-drawer entry point), because this would make the flow pretty clear to the user. Do you have anything in mind? |
It feels fine to me to have a send icon(beside share/delete) in the actionMode, it is better than piggybacking on the share intent anyhow. |
Please make a ticket @Aditya-Sood |
@Aditya-Sood it looks like you have run afould of travis being an annoying inconsistent environment. |
@Aditya-Sood merge dev in again, it should work now. Hopefully we get a green build |
@mhutti1 are there any changes for this PR? |
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.
Looks mostly good to me. Will leave to @macgills merge though as he has given the most feedback.
All good to me |
...in/java/org/kiwix/kiwixmobile/zim_manager/local_file_transfer/LocalFileTransferActivity.java
Show resolved
Hide resolved
@julianharty I haven't knowingly changed any file permissions. I wasn't aware that the new pre-commit hook added the .idea/codestyle file to my repo (I figured something was wrong with my local repo's .gitignore, which is why I removed all files and re-added them). Maybe re-adding is what caused the file permissions to change? If you could tell me what the permissions should be I'll more than happy to fix them |
Using the WiFi P2P API, the app can now be used to transfer ZIM files (from the Library) from one device to another.
Partially solves #1136
Requirements:
Steps for usage:
Opens a screen like so on the sender device:
Opens a screen like so on the receiver device:
Sender: Tap on the name of the destination device
Sender: Confirm receiver device
Sender device:
For some reason the files don't show up in the 'Library', but you can verify that they have been transferred by looking at the kiwix folder manually. This wasn't an issue with the previously used java code (from before merging develop: relevant commit), so I'm guessing there's an issue with the kotlin port.