permission

Source code for an Android AsyncTask (REST client) example alvin July 20, 2017 - 12:41pm

I just got back into using an Android AsyncTask, and it took me a little while to re-load the concepts in my head. I used AsyncTask’s a few years ago, but haven’t used them since.

To help remember how they work, I created a little AsyncTask example project, and I’ve included all of the source code for that project here. I’ll show all of the source code for my classes and configuration files, and then explain the code at the end.

The Android “adb shell list files permission denied” error

As a brief note, today I tried to list the files in my Android application, which was running on a physical Android device — a Nexus 9 — with this adb shell command:

adb shell com.alvinalexander.mybrowser ls /data/data/com.alvinalexander.mybrowser

When I did that, I got an Android/ADB “permission denied” error.

The short story is that a solution to this problem is to run the same command, but with the run-as argument, like this:

Android internet access error - java.net.UnknownHostException: Unable to resolve host

Android FAQ: “Help, I'm getting an internet access error with my Android application that says, "java.net.UnknownHostException: Unable to resolve host (hostname): No address associated with hostname". I think my HTTP/REST code is correct, what's wrong?”

If you get an error message like this:

Linux chmod command man page

This page shows the contents of the Linux chmod comamnd man page. This chmod command output was created on a CentOS Linux system.

You can see this same chmod command man page output by entering this command on your own Linux system:

Error message: mv cannot unlink remove file, operation not permitted

I got this Unix/Linux error message today "mv: cannot unlink '/tmp/forms-1.2.1.jar': Operation not permitted" when trying to move (mv) the file forms-1.2.1.jar from the /tmp directory to another directory. The full error output looked like this:

The beginning of a MySQL database script

Here is some code that I use at the beginning of a MySQL database script to (a) create a database, (b) create a local user to access that database ('foo_user'@'localhost'), (c) create a remote user that can access the database ('foo_user'@'%'), and (d) then use that database (which I need to do before starting a bunch of CREATE TABLE statements):

Linux ls command - How to show the permissions and size of a directory

How to see the permissions and size of a directory

Here's a short story :) on how to look at files and directories on a Unix/Linux computer system. I've seen so many people do this the hard way that I thought I should finally write something about it.