question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Moving hardcoded URLs from About Activity to a constant file

See original GitHub issue

Summary: There are many hardcoded strings which makes them difficult to locate and change the URL in case needed, so I think we should move them build.gradle file.

like

@OnClick(R.id.about_credits)
    public void launchCredits(View view) {
        Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons/blob/master/CREDITS/\\"));
    }

    @OnClick(R.id.about_privacy_policy)
    public void launchPrivacyPolicy(View view) {
        Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons/wiki/Privacy-policy\\"));
    }


    @OnClick(R.id.about_faq)
    public void launchFrequentlyAskedQuesions(View view) {
        Utils.handleWebUrl(this,Uri.parse("https://github.com/commons-app/apps-android-commons/wiki/Frequently-Asked-Questions\\"));
    }

Would you like to work on the issue? Yes

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
madhurgupta10commented, Apr 5, 2019

@maskaravivek I think, test can be written easily by using IntentMatchers.hasData() and passing the URL string from the constant file 😃

0reactions
maskaravivekcommented, Apr 4, 2019

Will it be difficult to write a unit test if the urls are in a constants file?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Moving Objective-C hard-coded string literals to constants ...
I have a project source code with like 100s of classes that liberally uses hard coded strings throughout the code.
Read more >
"Hard coded" vs. configuration files for values in libraries ...
The argument for having the values "hard-coded" is that you see the values right there in the code. The argument for having values...
Read more >
Hardcoded Delays - UiPath Documentation Portal
Rule ID: UI-PRR-004 Scope: Activity Description Displays a list of all the activities that contain hardcoded delay values in properties such as DelayMS, ......
Read more >
How to Easily Update URLs When Moving Your WordPress Site
Go ahead and enter the new link under the 'Target URL' field and select '301 Moved Permanently' as the Redirection Type from the...
Read more >
Dynamic URLs vs. static URLs | Google Search Central Blog
One example would be to generate files for all the paths and make them accessible somewhere on your site. However, if you're using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found