How to block all android application installation? Is there a way to block (by a password/PIN code or what else) all kinds of software installation on an Android tablet/smart phone by third-application or codes? I want to customize a android OS for my parents, but many apps may install other apps in background. So I try to install all apps for their need and disable all kinds of further installation.

Is there any way to do this? I can write code by myself, so if there is some code can do this, it will also be good for me.
To Implement this feature you need to set the device management policies 

Also you have to install the Google app for it from the link : Google Apps Device Policy

Set device management policies

All Google Apps domains have settings for mobile devices that you can apply to groups of users. There is a full list of settings in the Google Apps Administrator Help Center. Here we recommend settings for general device management and settings that are specific to Android tablets for education. To set up separate organizational units for teachers and students and place different restrictions for each group, see Manage tablets in the Google Admin console.

Device lockdown

When you configure a tablet for student use, the device is locked down. Google Play is permanently disabled on that device, and Wi-Fi and Bluetooth® settings require the administrator PIN for any changes. Additionally, the Device Policy app is automatically installed and activated on student tablets, which enforces all the device management policies that you set (except for the Password policy), regardless of whether the Enforce policies on Android devices setting is set for the student's organization. You can disable apps from the Admin console, and the following system apps are disabled, by default, on student devices:

Play Games

Play Movies &amp; TV

Play Music

Play Newsstand

Google Currents

Wallet

YouTube

Important: Due to these restrictions, we recommend that any tablets you give to teachers are NOT configured with the Android Device Enrollment app, but instead are clean tablets, out of the box.

General device management settings
In the Admin console, at Device management > Mobile > Device management settings, you'll find the following settings which apply to any device with an account on your domain, including students' or teachers' personal devices if they add their domain accounts to their personal devices. See the individual settings for our recommendations for schools with managed student tablets.

For more information on this refer the first link in this answer.