Read Custom file from /app/ folder - Android2019 Community Moderator ElectionFling gesture detection on grid layout'Must Override a Superclass Method' Errors after importing a project into EclipseIs quitting an application frowned upon?How do I get the SharedPreferences from a PreferenceActivity in Android?How to avoid reverse engineering of an APK file?How to manually include external aar package using new Gradle Android Build SystemBuilding and running app via Gradle and Android Studio is slower than via EclipseDoes anyone have benchmarks (code & results) comparing performance of Android apps written in Xamarin C# and Java?Dilemma: when to use Fragments vs Activities:android.os.FileUriExposedException: file:///storage/emulated/0/test.txt exposed beyond app through Intent.getData()
Does the US political system, in principle, allow for a no-party system?
What's the best tool for cutting holes into duct work?
Are there other characters in the Star Wars universe who had damaged bodies and needed to wear an outfit like Darth Vader?
School performs periodic password audits. Is my password compromised?
Did Amazon pay $0 in taxes last year?
What is the meaning of option 'by' in TikZ Intersections
Was it really inappropriate to write a pull request for the company I interviewed with?
Is there a math equivalent to the conditional ternary operator?
Ultrafilters as a double dual
Can a space-faring robot still function over a billion years?
Convert an array of objects to array of the objects' values
PTIJ: Aliyot for the deceased
Integrating function with /; in its definition
Quitting employee has privileged access to critical information
Professor forcing me to attend a conference
If nine coins are tossed, what is the probability that the number of heads is even?
Paper published similar to PhD thesis
What does it mean when I add a new variable to my linear model and the R^2 stays the same?
Remove object from array based on array of some property of that object
Why do we call complex numbers “numbers” but we don’t consider 2 vectors numbers?
Affine transformation of circular arc in 3D
I've given my players a lot of magic items. Is it reasonable for me to give them harder encounters?
Dukha vs legitimate need
Should we avoid writing fiction about historical events without extensive research?
Read Custom file from /app/ folder - Android
2019 Community Moderator ElectionFling gesture detection on grid layout'Must Override a Superclass Method' Errors after importing a project into EclipseIs quitting an application frowned upon?How do I get the SharedPreferences from a PreferenceActivity in Android?How to avoid reverse engineering of an APK file?How to manually include external aar package using new Gradle Android Build SystemBuilding and running app via Gradle and Android Studio is slower than via EclipseDoes anyone have benchmarks (code & results) comparing performance of Android apps written in Xamarin C# and Java?Dilemma: when to use Fragments vs Activities:android.os.FileUriExposedException: file:///storage/emulated/0/test.txt exposed beyond app through Intent.getData()
How can we read a file content which is located in the project /app/ folder?. My intention is to keep some credentials in that file and read the file in build.gradle
or in my application class
.
I looking for an implementation like Firebase "google-services.json" file.
android android-gradle android-file
add a comment |
How can we read a file content which is located in the project /app/ folder?. My intention is to keep some credentials in that file and read the file in build.gradle
or in my application class
.
I looking for an implementation like Firebase "google-services.json" file.
android android-gradle android-file
add a comment |
How can we read a file content which is located in the project /app/ folder?. My intention is to keep some credentials in that file and read the file in build.gradle
or in my application class
.
I looking for an implementation like Firebase "google-services.json" file.
android android-gradle android-file
How can we read a file content which is located in the project /app/ folder?. My intention is to keep some credentials in that file and read the file in build.gradle
or in my application class
.
I looking for an implementation like Firebase "google-services.json" file.
android android-gradle android-file
android android-gradle android-file
asked yesterday
Muhamed Riyas MMuhamed Riyas M
3,41811922
3,41811922
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
How can we read a file content which is located in the project /app/ folder?
Those are files on your development machine. They are not necessarily files on the device.
I looking for an implementation like Firebase "google-services.json" file.
AFAIK, that is used by a Gradle plugin on your development machine.
My intention is to keep some credentials in that file and read the file in build.gradle or in my application class.
Store the data in gradle.properties
. Those values can be accessed like global variables in your build.gradle
file. In addition to using those values directly, you can use buildConfigField
or resValue
statements in build.gradle
to make the values available to your app code (via BuildConfig
or values-type resources, respectively).
If you would prefer not to use gradle.properties
, you can create your own properties file, JSON file, XML file, etc. Your Gradle code would need to read in that file and extract values from it. Then, you can use buildConfigField
or resValue
to expose that data to your app code.
More elaborate possibilities include:
Storing your data as an XML resource (
res/xml/
) for use at runtime, and teach your Gradle script to parse that fileStoring your data as an asset (
assets/
) for use at runtime, and teach your Gradle script to parse that file
Thanks!. If I stored any where under "main" folder it can be identified by reverse engineering.
– Muhamed Riyas M
yesterday
@MuhamedRiyasM: Everything in your APK can be identified by reverse engineering.
– CommonsWare
yesterday
Oops!. But I cannot find the google-services.json file contents or even the file itself by reverse engineering!
– Muhamed Riyas M
yesterday
@MuhamedRiyasM: As I wrote, AFAIK, that is processed by a Gradle plugin, and it is not directly at runtime.
– CommonsWare
yesterday
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55023115%2fread-custom-file-from-app-folder-android%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
How can we read a file content which is located in the project /app/ folder?
Those are files on your development machine. They are not necessarily files on the device.
I looking for an implementation like Firebase "google-services.json" file.
AFAIK, that is used by a Gradle plugin on your development machine.
My intention is to keep some credentials in that file and read the file in build.gradle or in my application class.
Store the data in gradle.properties
. Those values can be accessed like global variables in your build.gradle
file. In addition to using those values directly, you can use buildConfigField
or resValue
statements in build.gradle
to make the values available to your app code (via BuildConfig
or values-type resources, respectively).
If you would prefer not to use gradle.properties
, you can create your own properties file, JSON file, XML file, etc. Your Gradle code would need to read in that file and extract values from it. Then, you can use buildConfigField
or resValue
to expose that data to your app code.
More elaborate possibilities include:
Storing your data as an XML resource (
res/xml/
) for use at runtime, and teach your Gradle script to parse that fileStoring your data as an asset (
assets/
) for use at runtime, and teach your Gradle script to parse that file
Thanks!. If I stored any where under "main" folder it can be identified by reverse engineering.
– Muhamed Riyas M
yesterday
@MuhamedRiyasM: Everything in your APK can be identified by reverse engineering.
– CommonsWare
yesterday
Oops!. But I cannot find the google-services.json file contents or even the file itself by reverse engineering!
– Muhamed Riyas M
yesterday
@MuhamedRiyasM: As I wrote, AFAIK, that is processed by a Gradle plugin, and it is not directly at runtime.
– CommonsWare
yesterday
add a comment |
How can we read a file content which is located in the project /app/ folder?
Those are files on your development machine. They are not necessarily files on the device.
I looking for an implementation like Firebase "google-services.json" file.
AFAIK, that is used by a Gradle plugin on your development machine.
My intention is to keep some credentials in that file and read the file in build.gradle or in my application class.
Store the data in gradle.properties
. Those values can be accessed like global variables in your build.gradle
file. In addition to using those values directly, you can use buildConfigField
or resValue
statements in build.gradle
to make the values available to your app code (via BuildConfig
or values-type resources, respectively).
If you would prefer not to use gradle.properties
, you can create your own properties file, JSON file, XML file, etc. Your Gradle code would need to read in that file and extract values from it. Then, you can use buildConfigField
or resValue
to expose that data to your app code.
More elaborate possibilities include:
Storing your data as an XML resource (
res/xml/
) for use at runtime, and teach your Gradle script to parse that fileStoring your data as an asset (
assets/
) for use at runtime, and teach your Gradle script to parse that file
Thanks!. If I stored any where under "main" folder it can be identified by reverse engineering.
– Muhamed Riyas M
yesterday
@MuhamedRiyasM: Everything in your APK can be identified by reverse engineering.
– CommonsWare
yesterday
Oops!. But I cannot find the google-services.json file contents or even the file itself by reverse engineering!
– Muhamed Riyas M
yesterday
@MuhamedRiyasM: As I wrote, AFAIK, that is processed by a Gradle plugin, and it is not directly at runtime.
– CommonsWare
yesterday
add a comment |
How can we read a file content which is located in the project /app/ folder?
Those are files on your development machine. They are not necessarily files on the device.
I looking for an implementation like Firebase "google-services.json" file.
AFAIK, that is used by a Gradle plugin on your development machine.
My intention is to keep some credentials in that file and read the file in build.gradle or in my application class.
Store the data in gradle.properties
. Those values can be accessed like global variables in your build.gradle
file. In addition to using those values directly, you can use buildConfigField
or resValue
statements in build.gradle
to make the values available to your app code (via BuildConfig
or values-type resources, respectively).
If you would prefer not to use gradle.properties
, you can create your own properties file, JSON file, XML file, etc. Your Gradle code would need to read in that file and extract values from it. Then, you can use buildConfigField
or resValue
to expose that data to your app code.
More elaborate possibilities include:
Storing your data as an XML resource (
res/xml/
) for use at runtime, and teach your Gradle script to parse that fileStoring your data as an asset (
assets/
) for use at runtime, and teach your Gradle script to parse that file
How can we read a file content which is located in the project /app/ folder?
Those are files on your development machine. They are not necessarily files on the device.
I looking for an implementation like Firebase "google-services.json" file.
AFAIK, that is used by a Gradle plugin on your development machine.
My intention is to keep some credentials in that file and read the file in build.gradle or in my application class.
Store the data in gradle.properties
. Those values can be accessed like global variables in your build.gradle
file. In addition to using those values directly, you can use buildConfigField
or resValue
statements in build.gradle
to make the values available to your app code (via BuildConfig
or values-type resources, respectively).
If you would prefer not to use gradle.properties
, you can create your own properties file, JSON file, XML file, etc. Your Gradle code would need to read in that file and extract values from it. Then, you can use buildConfigField
or resValue
to expose that data to your app code.
More elaborate possibilities include:
Storing your data as an XML resource (
res/xml/
) for use at runtime, and teach your Gradle script to parse that fileStoring your data as an asset (
assets/
) for use at runtime, and teach your Gradle script to parse that file
answered yesterday
CommonsWareCommonsWare
776k13918921938
776k13918921938
Thanks!. If I stored any where under "main" folder it can be identified by reverse engineering.
– Muhamed Riyas M
yesterday
@MuhamedRiyasM: Everything in your APK can be identified by reverse engineering.
– CommonsWare
yesterday
Oops!. But I cannot find the google-services.json file contents or even the file itself by reverse engineering!
– Muhamed Riyas M
yesterday
@MuhamedRiyasM: As I wrote, AFAIK, that is processed by a Gradle plugin, and it is not directly at runtime.
– CommonsWare
yesterday
add a comment |
Thanks!. If I stored any where under "main" folder it can be identified by reverse engineering.
– Muhamed Riyas M
yesterday
@MuhamedRiyasM: Everything in your APK can be identified by reverse engineering.
– CommonsWare
yesterday
Oops!. But I cannot find the google-services.json file contents or even the file itself by reverse engineering!
– Muhamed Riyas M
yesterday
@MuhamedRiyasM: As I wrote, AFAIK, that is processed by a Gradle plugin, and it is not directly at runtime.
– CommonsWare
yesterday
Thanks!. If I stored any where under "main" folder it can be identified by reverse engineering.
– Muhamed Riyas M
yesterday
Thanks!. If I stored any where under "main" folder it can be identified by reverse engineering.
– Muhamed Riyas M
yesterday
@MuhamedRiyasM: Everything in your APK can be identified by reverse engineering.
– CommonsWare
yesterday
@MuhamedRiyasM: Everything in your APK can be identified by reverse engineering.
– CommonsWare
yesterday
Oops!. But I cannot find the google-services.json file contents or even the file itself by reverse engineering!
– Muhamed Riyas M
yesterday
Oops!. But I cannot find the google-services.json file contents or even the file itself by reverse engineering!
– Muhamed Riyas M
yesterday
@MuhamedRiyasM: As I wrote, AFAIK, that is processed by a Gradle plugin, and it is not directly at runtime.
– CommonsWare
yesterday
@MuhamedRiyasM: As I wrote, AFAIK, that is processed by a Gradle plugin, and it is not directly at runtime.
– CommonsWare
yesterday
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55023115%2fread-custom-file-from-app-folder-android%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown