Add androidx source code to Android Studio project for debugging - android-source

I want to to add the androidx source code to my Android Studio project instead of using the provided library (implementation 'androidx.core:core-ktx:1.1.0'). Using the provided library I can only view the source code (it's read only during debugging), but I need to modify it for testing purposes.
So how can I add the androidx source code to Android Studio so I can edit it?

These repositories are usually being accessed with repo -
but for the sake of simplicity, git would also be supported:
git clone --branch androidx-master-dev https://android.googlesource.com/platform/frameworks/support /home/android/androidx-master-dev
Android Studio also supports git; the repository URL to check out would be https://android.googlesource.com/platform/frameworks/support and the branch is to select is eg. androidx-master-dev;. However, manually adding the library modules you need might be better.
Only the pre-built artifacts have version numbers, not the source-code. And it might only be known internally, which commit equals which version number; it doesn't seem to be publicly documented. See Android CI and Android Code Search; it says nothing about any version numbers there either.

(I don't have enough points to add a comment...)
As Martin said, Google has created a step by step guide how to download AndroidX, build it with gradle or Android Studio, make changes, import your custom build libs into your app, even contribute your changes upstream.

Related

Flutter package's own import target URI does not exist

I have a Flutter project that I started as a package in order for it to speak to platform specific native code. I've updated several packages lately along with flutter and my
import: package: mypackage/mypackage.dart
is no longer working. The dart analysis says the target URI doesn't exist and none of the of solutions for outside packages seem to work for me. Any ideas on how I can correct this issue?
Follow these steps:
flutter clean
flutter packages get
flutter packages upgrade (Optional)
Restart Android Studio or Visual Studio
I corrected the issue by downloading the clone that I recently pushed to git. I read through several entries that it could be related to pushing to git - especially is you forced a push.
If this is your situation 1) archive your local working copy 2) clone your project back from github/gitlab 3) run flutter packages get and flutter clean
If you understand how force pushing your project to git may effect package URI dependencies, please elaborate.

Workflow to upgrade a Flutter project/application

I have several Flutter projects that I have been working with for some time. Some a rather new and others are older. I constantly upgrade my Flutter SDK and switch between stable and beta channels. Everything works but the newer projects have different file layouts, for example .gitignore in android/ios folders, new XCode config files etc.
How do I update an older project to the new layout so as if it was just generated with flutter create?
Also there is this .metadata file generated which makes no sense to me. It never gets updated and only has it's project_type read by flutter_tools during flutter create. What is this for, why is it not being updated to the correct channel/rev?
Due to my research for the former question, I have run flutter create . in an existing project which generates some new files. Is this the only way, together with manually diffing to a new pristine project? And why is the .metadata file still outdated?
If anyone has some insights or documentation links regarding this, that would be great. I didn't find anything.
Update:
Apparently one can update the initially generated Flutter configuration files by re-running flutter create ..
Old:
Somewhat answering my own question here.
On March 3rd a commit was added to Flutter that added the notion of migrations to the iOS template/configuration (https://github.com/flutter/flutter/commit/e491544588e8d34fdf31d5f840b4649850ef167a).
These migrations take care of bringing the XCode configuration files to the latest version.
This commit has been ported back until Flutter 1.15.x.
This a great step forward. Hopefully similar migrations will be added for Android configurations and basic project files in the future.

How can i 'complete' my dart SDK rather than installing a separate version when using flutter?

I installed flutter by downloading and installing a release version.
It contains a partial dart SDK in its cache subfolder.
Namely, it's missing (amongst others executables) dart2native.
I realize I could just download and install a separate dart SDK from their website, then change all my paths to point to this newer, complete SDK. But that's exactly the problem - I do not wish to run 2 sdk version in parallel, it's confusing and likely will cause errors down the line (for example, my copy of android studio might be pointing at this or that SDK, and god knows what other tools might point towards it).
Question: is there a way to 'fill' my flutter dart SDK with the missing tools? Or am i doomed to run 2 version of dart SDK in parallel?
Answering my own question - after much googling, I found a repo maintainer stating that "For now, if you want to do to Dart development and use the Dart terminal commands (like dartfmt, pub, or dart2native), it's recommended that you download and install the Dart SDK. If you'd like you can also add it to path."
This is clearly sub-optimal. In fact just as I expected it seems to have led to a few people having faced issues, comment on https://github.com/flutter/flutter/issues/43968 if you'd like to see this addressed.

Where can I find the latest Movesense Showcase app source?

According to https://www.movesense.com/news/2020/02/movesense-showcase-ios-app-is-now-open-source/ the showcase app source is open source. But the source code that’s there in the repo is at least couple of versions behind in terms of UI.
Is there an updated repo location for the latest? Our client is looking at the app in AppStore thinking the source code should be the same.
Well, the source code in the repository is exactly the same as has been used for generating and compiling the app store version. Could you please make sure you are using the master branch of this repo: https://bitbucket.org/suunto/movesense-mobile-lib/ ?
Also, please make sure that you are opening the folder MovesenseShowcase in xcode, not IOS-example (which is the old example app for iOS)
In addition, please make sure you are using Xcode 11 (latest) and following the instructions in readme.md

Add flutter web and desktop to existing flutter (android/ios) project in android studio

I know it maybe still early but I want to try and use full flutter existing cross-platform support in one project. Stability is not my main concern.
I have started a flutter project in android studio. Naturally I have (android/Ios) going smoothly. But I would love to add Web and desktop to the same project.
Please help me with and direction, or if there is solution any one has created however much experimental.
There is a migration guide for web here. I got it up and running on a very basic existing app.
Best way is to do it in a separate branch since it requires changing packages and I even deleted .packages and pubspec.lock files first. Then I ran pub get (not flutter packages get) to download the required packages and run some precompilers.