Dialog XML File: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:layout_width="m...
<FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" app:layout_constraintTop_toBottomOf="@+id/main_topbar"> <VideoView android:id="@+id/videoViewMain" android:layout_width="match_parent" android:layout_he...
This may fix this error ---<br /> javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x6abff398:Failure in SSL library, usually a protocol error error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:7440x684dfce0:0x00000000) Add this t...
This is Example for Internet Permissions Android Manifest XML (for every Permissoin u need one of this fitting block) <!-- Declare Use Of Internet --><br /> <uses-permission android:name="android.permission.INTER...
In Constructor super.onCreate(savedInstanceState); // Disable Screenshots<br /> getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);<br /> setContentView(R.layout.activity_main); ...
Just a quick setup to render a pdf File. XML Fragment of Image view (somewhere in your layouts xml where you need it) <RelativeLayout<br /> android:id="@+id/relativeLayout"<br /> &a...
There is an easy way to avoid that your activity reloads if you change between portrait/landscape view.<br /> Define the class in the manifest file as follow: <br /> <activity android:name=".YourActivity&quo...
Here a simple Download Manager Class. Use like this: DownloadManager DM = new DownloadManager();<br /> DM.init(....);<br /> DM.execute(); Here the Class: import android.os.AsyncTask; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.io.PrintWriter; import java....
Passing the parameter Intent intent= new Intent(mContext,Activity.class);<br /> intent.putExtra("test","value")); Get value Intent intent=getIntent();<br /> msg_textview.setText(intent.getStringExtra("test")); ...
Here the code to display a video in a videoView element. VideoView videoview = findViewById(R.id.VIDEOVIEWID); Uri uri = Uri.parse(STRING PATH TO FILE); MediaController mediaController = new MediaController(this); mediaController.setAnchorView(videoview); videoview.setMediaController(mediaController); videoview.setVideoURI(uri); videoview.start(); ...
Simple Code to read a File in Android (FROM INTERNAL STORAGE) to a String String readFile(Context context, String filename) throws IOException { String ret = ""; InputStream inStream = context.openFileInput(filename); if ( inStream != null ) { InputStreamReader inputStreamReader = new InputStreamReader(inStream); Buffere...
Write a File in Android to Internal Storage from String void writeFile(String data, Context context, String filename) throws IOException { OutputStreamWriter outStream = new OutputStreamWriter(context.openFileOutput(filename, Context.MODE_PRIVATE)); outStream.write(data); outStream.close(); } ...