I was trying to evaluate effective permissions usage of an apk using axplorer mapping files.
During evaluation I obtained an effective use of the android.permission.INTERNET permission equal to 0.
This sounds pretty weird considering that this is maybe the most USED permission of all (android doc just tells an apk must declare this permission "In order to perform network operation"...)
This weird result depends on the fact that in axplorer mapping files there aren't mappings of famous "internet using" methods (java.net.HttpURLConnection, java.net.HttpsUrlConnection, java.net.Socket etc...) with android.permission.INTERNET permission.
I also knew that axplorer project replaced pscout project, so I took a look at pscout's mapping files either and found that in pscout's mapping files of android versions from Jelly Bean to Froyo there actually ARE mappings of java.net.HttpURLConnection, java.net.Socket etc.. methods with the permission, but for 4.11-5.11 android version, there is no mapping with these methods, and the mapping files become very similar to axplorer mapping files of android more recent versions.
Someone can help me find out why I'm seeing this strange case in permissions mappings?
I need to evaluate permissions effectively usage, but a "zero usage" of android.permission.INTERNET has really to be false... Someone can help me with that? Maybe there's something wrong in my idea?
currently my app is using a SQLiteOpenHelper to create or upgrade the underlying database. At the same time the app is creating some default database entries with file paths to images which are created in the following step (onCreate) or updating/migrating filepaths (and therefore moving images on external storage to a new location).
Until Android M everything was ok, because all necessary permissions were available. Now with M and targetApi = 23 my app has no longer the permission.
This shows that my solution was never a good one ;)
Whats the best way to do onCreate-Default-Operations or onUpgrade-Migrations which need permissions? Anyone who has the same or a similar problem?
regards,
Thomas
I've read many posts about this but nothing seems to solve the problem.
I've created a simple app that basically consists of:
Log.d("RSE", Environment.getExternalStorageState());
Log.d("RSE", "Readable? " + Environment.getExternalStoragePublicDirectory("Movies").canRead());
It always says mounted and Readable? false
When I try to do anything more, I get a permission denied error.
I've added
<uses-permission android:name="ANDROID.PERMISSION.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="ANDROID.PERMISSION.READ_EXTERNAL_STORAGE" />
inside AndroidManifest.xml inside the <manifest> tag and before the <application> tag.
Depending on the device, I've personally found Environment.getExternalStorage*() to be unreliable in what it points to. In this case, it's probably pointing to the emulated storage which doesn't seem to like I/O. I ended up just using "/sdcard/Movies/" which worked far more reliably than Environment.getExternalStoragePublicDirectory("Movies") ever did.
I have no idea why but I recreated the AVD and now its readable.
I wrote an app which loads datas (text and images) from a MYSQL DB from a webserver. In the emulator the program works fine. Then I tried it with my native device HTC in the 'debug as' modus. Still fine. But when I unplug the device and run it standalone the images are not being loaded anymore.
The 'funny' thing is, that I have one image called 'default.jpg' it is in the same folder as all the other images which are called like 'AB-123_1.jpg. The 'default.jpg' is the only image which loads also in the 'standalone' modus. I also gave it a try with renaming the images to some simple names like blabla.jpg. But it did not helped.
It's my first app, so maybe I just missed something.
The only real suggestions I can make are:
Pop up an alert in the catch poriton of your exception handling
Look into using traceview - not sure if it will help here, as I've only ever used it for profiling
According to Redirect Log output to sdcard on customer's phone, the app Catalog may be of some use (not tried it)
Try doing a clean build and uninstalling your app from the phone first, just in case of weirdness with code not rebuilding properly
Just to rule out the obvious (which should break debug builds anyway), but did you specify
<uses-permission android:name="android.permission.INTERNET"/>
in the AndroidManifest.xml?
Hope this helps,
Phil Lello
Can anybody explain me in simple words what is the use of Manifest file and
R.java file in android.
Why do we need these files while making an application?
check this link,
http://developer.android.com/guide/topics/manifest/manifest-intro.html
Manifest
Every application must have an
AndroidManifest.xml file (with
precisely that name) in its root
directory. The manifest presents
essential information about the
application to the Android system,
information the system must have
before it can run any of the
application's code
R.Java
It will have identifier for all resource used in our project
thank you.
Manifest file:
It is a declaration file.
Here only Which activity should start first, that has been declared.
It declares which permissions the application must have.
It also declares the permissions that others are required to have in order to interact.
It declares the minimum level of the Android API.
It lists the libraries that the application must be linked.
All the component should declared here.
The components are activities, services, broadcast receivers, and content providers.
R.java file:
It is an auto-generated file by aapt (Android Asset Packaging Tool) that contains resource IDs for all the resources of res/ directory.
If you create any component in the activity_main.xml file, id for the corresponding component is automatically created in this file.
This id can be used in the activity source file to perform any action on the component.
Every application must have an AndroidManifest.xml file (with precisely that name) in its root directory. The manifest presents essential information about the application to the Android system, information the system must have before it can run any of the application's code.
Check the following link
http://developer.android.com/guide/topics/manifest/manifest-intro.html
A project's R.java file is an index into all the resources defined in the file. You use this class in your source code as a sort of short-hand way to refer to resources you've included in your project. This is particularly powerful with the code-completion features of IDEs like Eclipse because it lets you quickly and interactively locate the specific reference you're looking for.
Check the following link
http://developer.android.com/resources/tutorials/hello-world.html
In short terms Manifest provide the basic information of the application to Android Operating system.
For example say you have a feature in your app that scans a QR code which requires your app to access camera that won't work until unless you get the consent of the user to access their's phone camera which is done by runtime permissions.These permissions needs to be defined in the Manifest file for Android OS to know that this app will be using something related to camera of user's phone.
The manifest file describes essential information about your app to the Android build tools, the Android operating system, and Google Play.
The permissions that the app needs in order to access protected parts of the system or other apps.
The hardware and software features the app requires.
The manifest declares anything that the operating system needs to know about your application.
You declare what permissions the OS will grant to your app when it executes.
You will also declare package information about your app. By doing that the OS will know what applications are installed.
Finally, you will declare custom implementations of the Foud Application Components (Activity, Service, BroadcstReceiver and ContentProvider classes) you have made.
You see, your application, any activities and services are not created by you. They are constructed by the OS through intents on behalf of your app. Likewise, all BroadcastReceivers need to be registered at the manifest, so the OS knows what application's receivers are registered to receive a broadcast, so it notifies them. Finally all ContentProviders must also be declared in the manifest so other applications can register to be provided content by your content provider.
In other words, in the manifest you put everything that the OS needs to know about your app in order to execute it and manage its components. Infact, anything you cannot access or declare directly by code, and you need the OS to take care of it...
I think it is a good idea for you to read through the Android Hello World.
Both AndroidManifest and R.java are explained.