-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add support for Android #682
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
base: master
Are you sure you want to change the base?
Conversation
|
Thanks Were you able to get it working on an actual Android device? |
you can run it on device, but there is no ffmpeg implemented to get path to it from resources and using it to convert files when you are searching for items we need to make a UI thread to update the UI otherwise Java exception the WebView is broken, when you auth (desktop) it opens the youtube page like you would normally login in browser youtube, it doesn't "auth" you completely. there is no button for auth in Android version of app for some reason for now there are a few minor visual bugs for dialogs, that you just add margin to them and they work fine. There are no permissions added to "export" audio/video of file converted. |
|
This PR is still ongoing, you can push it now and help me with development, or I can try to do everything myself and when I will finish with everything you can merge the pull |
|
@Tyrrrz Progress:
|
YoutubeDownloader.Android/.gitignore
Outdated
| @@ -0,0 +1,7 @@ | |||
| arm | |||
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.
Where do these directories/files come from?
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.
I removed "unused" arch and forgot to remove them from gitignore
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.
Also, when you are compiling the android project the powershell script at the time of compiling will install all of the binaries for android (like you did with ffmpeg) and will ignore them (not include them to git proj)
| // Set execute permissions | ||
| try | ||
| { | ||
| var process = System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo |
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.
Might as well use CliWrap here
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.
Never used your CliWrap. Sorry. If you wish to do it yourself you can later.
| var currentArch = GetAndroidArchitecture(); | ||
|
|
||
| // Remove any previously extracted FFmpeg binaries from other architectures | ||
| await Task.Run(() => |
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.
Why does this require a new Task?
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.
Will remove it
| } | ||
| } | ||
|
|
||
| private static string GetAndroidArchitecture() |
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 like this method can just be inlined into a single switch expression
…lems with release apk.
|
Good enough Android MVP. Would be good in future:
There are maybe things other things good to be added, but I am not aware of them right now. Instructions on how to compile Release:
|
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.
Pull Request Overview
This PR adds support for the Android platform by splitting the projects into platform‐specific csproj files, integrating Android permissions and manifest updates, and addressing issues such as main thread exceptions and FFmpeg compatibility.
- Splits platform-specific code into separate projects for Android and Desktop
- Integrates Android-specific permissions, resources, and manifest changes
- Applies visual fixes and updates FFmpeg integration for cross-platform compatibility
Reviewed Changes
Copilot reviewed 45 out of 52 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| YoutubeDownloader/YoutubeDownloader.csproj | Removed Windows-specific properties and upgraded Avalonia package versions |
| YoutubeDownloader/Views/*.axaml(.cs) | Changed view inheritance (Window→UserControl) and updated layouts for improved UI consistency |
| YoutubeDownloader/ViewModels/* | Adjusted platform-specific file handling and updated FFmpeg & program info references |
| YoutubeDownloader/Framework/* & Utils/* | Changed internal types to public for broader accessibility as needed |
| YoutubeDownloader.Android/* | Added new Android project with permissions, manifest, resource files, and FFmpeg initialization support |
| YoutubeDownloader.Desktop/* | Created a new Desktop project for Windows with adjustments specific to desktop requirements |
|
Some notes on the merge conflicts:
|
DONE: