Add cpu abi info

master
徐灿辉 5 years ago
parent c92f37c470
commit 2262711a28
  1. 14
      app/src/main/java/com/github/xch168/ffmpeg/invoker/demo/MainActivity.java
  2. 3
      app/src/main/res/layout/activity_main.xml

@ -1,5 +1,6 @@
package com.github.xch168.ffmpeg.invoker.demo; package com.github.xch168.ffmpeg.invoker.demo;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.widget.TextView; import android.widget.TextView;
@ -13,9 +14,16 @@ public class MainActivity extends AppCompatActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
// Example of a call to a native method TextView tv = findViewById(R.id.tv_cpu_abi);
TextView tv = findViewById(R.id.sample_text); tv.setText("CPU_ABI: " + getCpuAbi());
tv.setText(""); }
private String getCpuAbi() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
return Build.CPU_ABI;
} else {
return Build.SUPPORTED_ABIS[0];
}
} }
} }

@ -7,10 +7,9 @@
tools:context="com.github.xch168.ffmpeg.invoker.demo.MainActivity"> tools:context="com.github.xch168.ffmpeg.invoker.demo.MainActivity">
<TextView <TextView
android:id="@+id/sample_text" android:id="@+id/tv_cpu_abi"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"

Loading…
Cancel
Save