Blocking calls on android - android

I am creating an Android app for blocking contact numbers on android . I am stuck in AndroidManifest.xml. Android studio is giving this error while I have an icon.png file in my res/drawable!
image is here.
I have no idea how to turn simple app into system app!image of error is [here].2

Please remove the .png from your manifest file.
You don't need to add the file extension in manifest file
or layout file. Just the name, without the file extension, will do.
So, your entry should look like this:
android:icon="#drawable/icon"

Remove the ".png" from you manifest, you do not define that here. Also: You should provide proper drawables for different display densities. You could e.g. use this online generator to get them Android Assets Studio : Launcher icons
When you want to use the MODIFY_PHONE_STATE permissions your users will most likely need an open bootloader and root to use your app. You can find some instructions here. You can't move apps to /system without mounting system rewritable, which you need root for. Alternative: Users have to use a custom recovery to push the app to /system, which requires an open bootloader at least.

Related

Opening Files from a String Path with Android NDK

I've been going over the Android file access documentation lately, but I seem to be unable to figure out how to actually open a file given as a string containing the path to the file I'd like to open.
What I (eventually) want to accomplish is something like this:
The user selects a specific kind of text file using Intents, receiving a URI to the file. From this I derive the path (getPath()) and pass this string to the native C++ code.
The native C++ opens the file from the string, parsing the content.
Perform some actual work with the above.
From what I've found so far, it seems like it is no longer possible to open files this way (as of SDK version 26 at least):
A hard-coded path to a file I know exists gives me permission denied.
The path itself received from getPath() triggers a No such file or directory error.
One workaround called for opening the file on the Java side using the ContentResolver, and then passing the file descriptor to the native side. This works, but it's problematic: the files can contain references to other files to be opened ("include files") making such a solution of limited use.
Just to make things clear, these files reside locally on the "USB" partition of the Android system, unrelated to the app itself. Not as resources/assets to the APK or anything similar which other questions of this kind seem to require.
In summary, I guess the question is this: Is it possible to open a file, and possibly any other files it refers to, given a path from the Java side of the application? Is there any requirements for doing this, such as requesting the correct permissions for folders or something similar?
As of Android 6.0 (API level 23) you need to request permissions every time your app starts for "dangerous actions" such as accessing the filesystem or reading contacts. The linked pages already have a snippet of code you can copy.
On older phones requesting permissions in the manifest was sufficient, but the target SDK version was recenly upped to 8.0 (=26). If you want to support devices pre-6.0, the Android compatibility library will allow you to call the same API.

Does a file operation (move, rename) change last modified field of a file?

What does "lastmodified" describe? Just the file's content or also file system related things like file name and Path?
My interest goes especially for the Android platform. I will store data in my app's directory. A quick test showed, that a Samsung Android device with Android 4.2.2 does not change the date when moving files with the build in file browser.
from my experience it doesnt change it. After such operations I manually do
file.setLastModified(System.currentTimeMillis());

Can I rename AndroidManifest.xml?

I create different android project in eclipse, but every project include the same name AndroidManifest.xml, can I rename AndroidManifest.xml? Thanks!
No..manifest file work as bridge between your Application and the Android os.so It must be with same name.if you rename Android os doesnt know about your Application..
A big NO and why you want to change name ?
UPDATE
Every application must have an AndroidManifest.xml file in its root directory.
The manifest file presents essential information about your app to the Android system, information the system must have before it can run any of the app's code.
No you can't rename this. For more information you can read this topic:
https://developer.android.com/guide/topics/manifest/manifest-intro.html
No you cannot rename it, the reason behind this is that it has been used by the android OS, to know the Permissions, as well as to know which activity should be opened at what time. All such controls are written in this AndroidManifest file. So changing its name is not allowed.

Where are the Android manifest file data saved in Android?

I am working on an Android project where I want to change the permissions of an application at runtime.
To achieve that, I thought of changing the android:permission tag in the Android Manifest file.
But to change this at run time, I guess it might be possible to change the database where Android manifest file's data are stored.
Please let me know where this database is stored and is it feasible to change it at runtime.
The Manifest.xml file is stored in the signed apk which is in the systems area that you don't have access to without root. So it would only work on rooted devices, you would need to obtain root, possible decrypt the apk, unzip it, make the modification and then, somehow, resign it with the original keystore that was initially used. If you are trying to modify one of your own apps I guess it's possible but it seems like a lot of trouble to go to.

File permission issues in android

PFA the png, in this please note the permissions for the images inside app_themes directory. I am creating and adding files to this directory(app_themes) and during the process I do not specify any permissions at all.
Now I can see, for some png's the permission is rwxrwxrwx and for some others, it is just rw.
Though I do not specify any permission at all, why this difference in permission occurs?
I have no issues while I access a file with rwxrwxrwx from a different application, but cannot access those files which has only rw permission from a second application.
Please let me know how to resolve this by having the same permission - rwxrwxrwx for all the files.
This behaviour of android seems slightly strange!
Any help is much appreciated.
In first place, why android sets different permissions for different files, though the files are created using the same code?

Categories

Resources