How to add more videos to my app - Android Studio

How to add more videos to the app?
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I have created an app that contains a video, it works fine now I want to add more video to the list,
here are the codes I used:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
androidaddingLeft="1dp"
androidaddingRight="1dp">
<VideoView
android:id="@+id/vdVw"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center" />
</RelativeLayout>
Maina_Activity.java:
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;
public class MainActivity extends AppCompatActivity {
u/Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
VideoView videoView =(VideoView)findViewById(R.id.vdVw);
//Set MediaController to enable play, pause, forward, etc options.
MediaController mediaController= new MediaController(this);
mediaController.setAnchorView(videoView);
//Location of Media File
Uri uri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.video1);
//Starting VideView By Setting MediaController and URI
videoView.setMediaController(mediaController);
videoView.setVideoURI(uri);
videoView.requestFocus();
videoView.start();

Related

[Guide ][GB][how to put analog clock on lockscreen]

OK, let's go!
decompile your framework-res.apk-
go to the folder framework-res/res / layout and search for "keyguard_screen_tab_unlock.xml"
open the xml and below the
HTML:
<com.android.internal.widget.DigitalClock android:id="@id/time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="0.0dip" android:layout_marginRight="10.0dip" android:layout_marginBottom="0.5dip" android:layout_below="@id/carrier_sub2" android:layout_centerInParent="true">
put this code
HTML:
<LinearLayout android:gravity="center" android:layout_width="wrap_content" android:layout_height="wrap_content">
<AnalogClock android:gravity="center" android:id="@id/clock" android:layout_width="121.0dip" android:layout_height="121.0dip" android:dial="@drawable/circle" android:hand_hour="@drawable/pu" android:hand_minute="@drawable/os" android:layout_centerVertical="true" />
</LinearLayout>
now in id.xml put this code above the </resources>
HTML:
<item type="id" name="clock">false</item>
download the files and put on folder drawable-mdpi, now recompile and sign the apk :laugh:
Screen
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
And press button thanks
Thanks bro,it works well.
来自搭载Android 2.3 GingerBread的华为Y220-T10

[Q] Display data to table

Hi. I can't seem to find solution for displaying data in my app. I already did program in regular Java using jTable and DefaultTableModel for adapting data for my table. But what is alternative in A.Studio? Here is what my app looks like:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
and data consists of 3 columns:Name,LastName,PhoneNu. seperated by tab:
Here is example how table looks in Java using SWING:
And here is the code I was planing on using:
Code:
void showData() {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(
openFileInput("phonebook.txt")));
String line;
StringBuffer stringBuffer = new StringBuffer();
try {
while ((line = br.readLine()) != null) {
stringBuffer.append(line + "\n");
}
//textView.setText(stringBuffer.toString());
} catch (IOException e) {
e.printStackTrace();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
...
button2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showData();
}
});
Than you for any advice.

Blurred images in Android Studio

Im making a pixel art game in Android Studio.
My question is, is possible to don't get the image blurred? Here is the example:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Here is my layout:
Code:
Here is my layout:
<!-- logo-app -->
<ImageView
android:layout_width="516px"
android:layout_height="122px"
android:id="@+id/logo_engine"
android:layout_gravity="center"
android:src="@drawable/logoengine"
android:contentDescription="@null" />
The imagen is 516x122 px so the size is correct but I dont know if the device zooms the application..
For example, the same App in Adobe Air, fits correctly because is designed in 240×320px and the device fits the application to screen perfectly. The application Is zoomed but pixels are zoomed perfectly. Is there any way to conserve the pixels and don't get blurred images?
Thanks!
Use a SVG format picture. But I'm not sure that will work in Android Studio
Sent from my Nexus 9 using XDA-Developers mobile app

[Tweak] Disable Lockscreen Album Art - CM14 [No Xposed required]

Warning, this will only work WITH CM 14, NOT earlier versions.
In a nutshell, this is a modified SystemUI.apk that disables the lockscreen album art feature that was introduced in KK.
In theory, this should not be exclusive to the OPO and should work on all CM 14 builds. HOWEVER, flash at your own risk. I will not be responsible for any bootloops, bricks (impossible to imagine but, ppl never fail to amaze me) or thermonuclear war that may result from flashing this file.
What was modified: https://github.com/CyanogenMod/andr.../systemui/statusbar/phone/PhoneStatusBar.java
In this file, the following was changed:
Code:
public static final boolean SHOW_LOCKSCREEN_MEDIA_ARTWORK = true;
to
Code:
public static final boolean SHOW_LOCKSCREEN_MEDIA_ARTWORK = false;
In this zip, I have included an addon.d script. That way, it should survive dirty flashes.
Special thanks to @danieldmm for compiling the SystemUI.apk. Check out his awesome CM 14 ROM here
Mirror: https://www.dropbox.com/s/m5eg2ed4ui0w99g/NoAlbumArt.zip?dl=0
Screenshot said:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Click to expand...
Click to collapse

Lawnchair Launcher White Tab/Teal Mod

• Reverts the translucent tab background, back to white.
• Changes the default color from Pixel blue to AOSP teal. (009688)
• Based on the latest Lawnchair 1.1.0.1834 > https://lawnchairmirror.duckdns.org/
• Uninstall any previous version of Lawnchair to install this modded version.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
DIY
1. res > drawable > bg_pixel_qsb_connector
Code:
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@android:color/white" />
</shape>
2. res > values > colors > accent_material_light
Code:
<color name="accent_material_light">[COLOR="Teal"]#ff009688[/COLOR]</color>
Updated to ...1834 and added a DIY, Enjoy.

Categories

Resources