Application ID in appengine is configured in appengine-web.xml:
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>myid</application>
<version>0-0-1</version>
</appengine-web-app>
Can we acces the application id programmatically in Java?
From the Runtime Environment documentation you can use
SystemProperty.applicationId.get()to get the application ID.