Code example for AssetManager

Methods: openFd

0
 
	/// JNI Function used to fetch an APK Resource file descriptor. Called from native code 
	public static AssetFileDescriptor getAssetFileDescriptor(String assetName){
		AssetFileDescriptor fp = null;
		try{	 
			fp = assetManager.openFd(assetName);
		}catch(IOException ioe){
			/// Handle asset loading exception 
			Log.v("ParabolaEngine", "Asset file fetch exception: " + ioe.getMessage());
		} 
		return fp;
	} 
 
	/// JNI Function to send an SMS through the android device. Called from native code 
	public static void sendSMS(String number, String sms){
		SmsManager sm = SmsManager.getDefault();
		sm.sendTextMessage(number, null, sms, null, null);
		ContentValues values = new ContentValues();
		values.put("address", number);
		values.put("body", sms);
Experience pair programming with AI  Get Codota for Java