Source/CSBackend/Platform/Android/Main/Java/com/chilliworks/chillisource/core/AppConfig.java
/**
	 * Reads the properties from the App.config file.
	 *
	 * @author S Downie
	 * 
	 * @param The activity
	 */
Reads the properties from the App.config file.
@author S Downie

@param The activity
Reads the properties from the App . config file . @author S Downie @param The activity
private void parse(Activity in_activity)
	{
		if (FileUtils.doesFileExistAPK(in_activity, k_configFilePath))
		{
			byte[] byteContents = FileUtils.readFileAPK(in_activity, k_configFilePath);
			String stringContents = StringUtils.UTF8ByteArrayToString(byteContents);
			try
			{
				JSONObject root = new JSONObject(stringContents);
				if (root.has("PreferredSurfaceFormat") == true)
				{
					m_surfaceFormat = root.getString("PreferredSurfaceFormat");
				}
				if(root.has("Android") == true)
				{
					JSONObject android = root.getJSONObject("Android");
					if(android.has("PreferredSurfaceFormat") == true)
					{
						m_surfaceFormat = android.getString("PreferredSurfaceFormat");
					}
					if(android.has("GooglePlay") == true)
					{
						JSONObject googlePlay = android.getJSONObject("GooglePlay");
						if(googlePlay.has("RequiresGooglePlayServices") == true)
						{
							m_requiresGooglePlayServices = googlePlay.getBoolean("RequiresGooglePlayServices");
						}
					}
				}
			}
			catch (Exception e)
			{
				Logging.logFatal("Could not load App.config!");
			}
		}
		else
		{
			Logging.logFatal("App.config does not exist!");
		}
	}
private void parse ( Activity in_activity ) { if ( FileUtils . doesFileExistAPK ( in_activity , k_configFilePath ) ) { byte [ ] byteContents = FileUtils . readFileAPK ( in_activity , k_configFilePath ) ; String stringContents = StringUtils . UTF8ByteArrayToString ( byteContents ) ; try { JSONObject root = new JSONObject ( stringContents ) ; if ( root . has ( "PreferredSurfaceFormat" ) == true ) { m_surfaceFormat = root . getString ( "PreferredSurfaceFormat" ) ; } if ( root . has ( "Android" ) == true ) { JSONObject android = root . getJSONObject ( "Android" ) ; if ( android . has ( "PreferredSurfaceFormat" ) == true ) { m_surfaceFormat = android . getString ( "PreferredSurfaceFormat" ) ; } if ( android . has ( "GooglePlay" ) == true ) { JSONObject googlePlay = android . getJSONObject ( "GooglePlay" ) ; if ( googlePlay . has ( "RequiresGooglePlayServices" ) == true ) { m_requiresGooglePlayServices = googlePlay . getBoolean ( "RequiresGooglePlayServices" ) ; } } } } catch ( Exception e ) { Logging . logFatal ( "Could not load App.config!" ) ; } } else { Logging . logFatal ( "App.config does not exist!" ) ; } }
Reads the properties from the App.config file.
Reads the properties from the App . config file .