René's URL Explorer Experiment


Title: [Proposal] Improve workflow of extending Android classes required at runtime (e.g. Activity, Application, etc.) · Issue #465 · NativeScript/android · GitHub

Open Graph Title: [Proposal] Improve workflow of extending Android classes required at runtime (e.g. Activity, Application, etc.) · Issue #465 · NativeScript/android

X Title: [Proposal] Improve workflow of extending Android classes required at runtime (e.g. Activity, Application, etc.) · Issue #465 · NativeScript/android

Description: Overview This proposal aims to develop further the previous story of extending Android classes required at build time. At present we use a project template that is located in platforms/android directory which doesn't and shouldn't contai...

Open Graph Description: Overview This proposal aims to develop further the previous story of extending Android classes required at build time. At present we use a project template that is located in platforms/android dire...

X Description: Overview This proposal aims to develop further the previous story of extending Android classes required at build time. At present we use a project template that is located in platforms/android dire...

Opengraph URL: https://github.com/NativeScript/android/issues/465

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Proposal] Improve workflow of extending Android classes required at runtime (e.g. Activity, Application, etc.)","articleBody":"## Overview\n\nThis proposal aims to develop further the [previous story](https://github.com/NativeScript/android-runtime/issues/283) of extending Android classes required at build time. At present we use a project template that is located in `platforms/android` directory which doesn't and shouldn't contains files eligible for version control. Hence the need for this issue.\n## Proposal\n\nThere are lots of scenarios where it is required to extend Android classes used at build time. Often when using various SDKs, for example YouTube SDK, we have to extend third party types, like `Activity`, which are then used in `AndroidManifest.xml`. These types may contain application specific code and so they should be part of the app source code tree shown below\n\n```\n\u003cproj dir>\n|-app\n|  |-App_Resources\n|     |-Android\n|       |-AndroidManifest.xml\n|       |-app.gradle\n|       |-...\n|-node_modules\n|-platforms\n    |-android\n       |-src\n       | |-main\n       |   |-assets\n       |   |-java\n       |   |-res\n       |-...\n```\n\nInstead of storing the extended classes in `platforms/android/src/main/java` directory we can adjust the directory structure as follows\n\n```\n\u003cprojdir>\n|-app\n|  |-App_Resources\n|     |-Android\n|     | |-AndroidManifest.xml\n|     | |-app.gradle\n|     | |-main\n|     |   |-assets\n|     |   |-java\n|     |   |-res\n|     |-...\n|-node_modules\n|-platforms\n    |-android\n       |-src\n       | |-main\n       |   |-assets\n       |   |-java\n       |   |-res\n       |-...\n```\n\nThe idea is to preserve as much of the current `gradle` folder structure so it is familiar to the Android developers and avoid NIH syndrome. The exact location can be additionally configured through `extend` syntax for JavaScript programmers or through a [decorator](https://github.com/NativeScript/NativeScript/blob/v2.0.0/ui/frame/frame.android.ts#L674) for TypeScript ones. For example\n\n```\n// MyActivity.ts\n@JavaProxy(\"com.example.MyActivity\")\nclass MyActivity extends com.google.android.youtube.player.YouTubeBaseActivity {\n...\n}\n```\n\nAnd the generated file will be stored in `\u003cprojdir>/app/App_Resources/Android/main/com/example` directory. In case when a static binding generator is used it should keep track whether the generated file is changed by the developer and prints a warning instead of overwriting the file. The usual way for doing this is to use the file last update time-stamp. It is up to the developer to resolve any potential conflicts.\n\nAs a first step we can add keep the existing `NativeScriptApplication` and `NativeScriptActivity` classes and add support for \"secondary\" activities (we keep `NativeScriptActivity` as a main one). The sole reason for this suggestion is that some changes in the  tns modules are required. Please note that this step can be revisited if the aforementioned change is easy and won't require much time to implement.\n## Technical Details\n\nI outlined some of the details but here is more detailed info.\nThe default platform specific directory (`\u003cplatdir>`) is  `\u003cprojdir>/app/App_Resources/Android/main`. This can be configured through the existing `settings.gradle` file.\n### When No Static Binding Generator Is Used\n- All drawables are moved to `\u003cplatdir>/res` directory\n- During build `\u003cplatdir>` is copied to `\u003cprojdir>/platforms/android/src` overwriting all existing files\n\nIn this scenario the developer has full control over both the JavaScript and Java files. There is no synchronization between the source and the destination folders, it is one-way file copy. The `tns` CLI should provide `tns clean` command so it will be possible to clean `\u003cprojdir>/platforms/android` directory.\n### When Static Binding Generator Is Used\n- All drawables are moved to `\u003cplatdir>/res` directory\n- During build `babeljs` will parse all JavaScript/TypeScript files looking for extending native classes\n- The static binding generator will use this information and writes the `*.java` files `\u003cplatdir>/java`. If a file with newer time-stamp exists then a warning will be shown and the file won't be overwritten. The `tns` CLI will provide an option (e.g. `--binding-overwrite`) in order to overwrite an existing file\n- During build `\u003cplatdir>` is copied to `\u003cprojdir>/platforms/android/src` overwriting all existing files\n## Impact\n\nThe current proposal does not have any breaking changes.\n## Summary\n\nThis proposal makes it possible to create custom non-main activities or other classes required during build time. In order to provide full ull support for main activities further change in tns modules is required.\n","author":{"url":"https://github.com/slavchev","@type":"Person","name":"slavchev"},"datePublished":"2016-05-26T08:21:52Z","url":"https://github.com/NativeScript/android/issues/465"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:6660e8ba-daad-f13f-d544-598d119b05f9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9CCC:2564D8:159F710:1C8EB7B:6B012C1C
html-safe-nonce6976d0136498a011058d37bc207d37d2bb788326815caf62a6c6daf0b3365055
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Q0NDOjI1NjREODoxNTlGNzEwOjFDOEVCN0I6NkIwMTJDMUMiLCJ2aXNpdG9yX2lkIjoiNzc3MTc0NzMwNTM0MTkyMjMzMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac73714e87674548f3127c191994fc4628770ac2551741a21906264a4f74f83897
hovercard-subject-tagissue:156929652
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/android/465/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3bb21cbc1e3db700bf78c5a7b4691efd6eeb7b28e8bca774d377e567f3974826/NativeScript/android/issues/465
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3bb21cbc1e3db700bf78c5a7b4691efd6eeb7b28e8bca774d377e567f3974826/NativeScript/android/issues/465
og:image:altOverview This proposal aims to develop further the previous story of extending Android classes required at build time. At present we use a project template that is located in platforms/android dire...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameslavchev
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/NativeScript/android git https://github.com/NativeScript/android.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id29137950
octolytics-dimension-repository_nwoNativeScript/android
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id29137950
octolytics-dimension-repository_network_root_nwoNativeScript/android
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/NativeScript/android/issues/465#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fandroid%2Fissues%2F465
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fandroid%2Fissues%2F465
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=NativeScript%2Fandroid
Reloadhttps://github.com/NativeScript/android/issues/465
Reloadhttps://github.com/NativeScript/android/issues/465
Reloadhttps://github.com/NativeScript/android/issues/465
NativeScripthttps://github.com/NativeScript
androidhttps://github.com/NativeScript/android
Codehttps://github.com/NativeScript/android
Issues106 (106)https://github.com/NativeScript/android/issues
Pull requests24 (24)https://github.com/NativeScript/android/pulls
Actionshttps://github.com/NativeScript/android/actions
Projectshttps://github.com/NativeScript/android/projects
Wikihttps://github.com/NativeScript/android/wiki
Security and qualityhttps://github.com/NativeScript/android/security
Insightshttps://github.com/NativeScript/android/insights
https://github.com/NativeScript/android
New issuehttps://github.com/login?return_to=https://github.com/NativeScript/android/issues/465
New issuehttps://github.com/login?return_to=https://github.com/NativeScript/android/issues/465
[Proposal] Improve workflow of extending Android classes required at runtime (e.g. Activity, Application, etc.)https://github.com/NativeScript/android/issues/465#top
donehttps://github.com/NativeScript/android/issues?q=state%3Aopen%20label%3A%22done%22
featurehttps://github.com/NativeScript/android/issues?q=state%3Aopen%20label%3A%22feature%22
2.4.0https://github.com/NativeScript/android/milestone/20
https://github.com/slavchev
slavchevhttps://github.com/slavchev
on May 26, 2016https://github.com/NativeScript/android/issues/465#issue-156929652
previous storyhttps://github.com/NativeScript/android-runtime/issues/283
decoratorhttps://github.com/NativeScript/NativeScript/blob/v2.0.0/ui/frame/frame.android.ts#L674
slavchevhttps://github.com/slavchev
featurehttps://github.com/NativeScript/android/issues?q=state%3Aopen%20label%3A%22feature%22
on May 26, 2016https://github.com/NativeScript/android/issues/465#event-672847051
slavchevhttps://github.com/slavchev
on May 26, 2016https://github.com/NativeScript/android/issues/465#event-672847052
https://github.com/atanasovg
atanasovghttps://github.com/atanasovg
on Jun 27, 2016https://github.com/NativeScript/android/issues/465#issuecomment-228708260
https://github.com/NativeScript/android-runtime-docs/blob/master/advanced-topics/extend-application-activity.mdhttps://github.com/NativeScript/android-runtime-docs/blob/master/advanced-topics/extend-application-activity.md
petekanevhttps://github.com/petekanev
donehttps://github.com/NativeScript/android/issues?q=state%3Aopen%20label%3A%22done%22
on Jun 30, 2016https://github.com/NativeScript/android/issues/465#event-709083854
petekanevhttps://github.com/petekanev
completedhttps://github.com/NativeScript/android/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jun 30, 2016https://github.com/NativeScript/android/issues/465#event-709083915
petekanevhttps://github.com/petekanev
in progresshttps://github.com/NativeScript/android/issues?q=state%3Aopen%20label%3A%22in%20progress%22
on Jun 30, 2016https://github.com/NativeScript/android/issues/465#event-709084209
petekanevhttps://github.com/petekanev
on Jun 30, 2016https://github.com/NativeScript/android/issues/465#event-709084257
petekanevhttps://github.com/petekanev
donehttps://github.com/NativeScript/android/issues?q=state%3Aopen%20label%3A%22done%22
on Jun 30, 2016https://github.com/NativeScript/android/issues/465#event-709084337
petekanevhttps://github.com/petekanev
on Jun 30, 2016https://github.com/NativeScript/android/issues/465#event-709084791
https://github.com/Plamen5kov
Plamen5kovhttps://github.com/Plamen5kov
on Aug 8, 2016https://github.com/NativeScript/android/issues/465#issuecomment-238155247
Plamen5kovhttps://github.com/Plamen5kov
2.3.0https://github.com/NativeScript/android/milestone/19
2.2.0https://github.com/NativeScript/android/milestone/18
on Aug 11, 2016https://github.com/NativeScript/android/issues/465#event-752127600
slavchevhttps://github.com/slavchev
2.4.0https://github.com/NativeScript/android/milestone/20
2.3.0https://github.com/NativeScript/android/milestone/19
on Sep 19, 2016https://github.com/NativeScript/android/issues/465#event-793902935
https://github.com/atanasovg
atanasovghttps://github.com/atanasovg
on Sep 20, 2016https://github.com/NativeScript/android/issues/465#issuecomment-248228428
@Plamen5kovhttps://github.com/Plamen5kov
separate issuehttps://github.com/NativeScript/android-runtime/issues/561
atanasovghttps://github.com/atanasovg
completedhttps://github.com/NativeScript/android/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 20, 2016https://github.com/NativeScript/android/issues/465#event-795246583
atanasovghttps://github.com/atanasovg
donehttps://github.com/NativeScript/android/issues?q=state%3Aopen%20label%3A%22done%22
in progresshttps://github.com/NativeScript/android/issues?q=state%3Aopen%20label%3A%22in%20progress%22
on Sep 20, 2016https://github.com/NativeScript/android/issues/465#event-795246706
Sign up for freehttps://github.com/signup?return_to=https://github.com/NativeScript/android/issues/465
Sign in to commenthttps://github.com/login?return_to=https://github.com/NativeScript/android/issues/465
donehttps://github.com/NativeScript/android/issues?q=state%3Aopen%20label%3A%22done%22
featurehttps://github.com/NativeScript/android/issues?q=state%3Aopen%20label%3A%22feature%22
2.4.0https://github.com/NativeScript/android/milestone/20
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.