Basic tutorial on smart TV (TV box) development (with sdk) and basic tutorial sdk

Source: Internet
Author: User

Basic tutorial on smart TV (TV box) development (with sdk) and basic tutorial sdk

To solve box compatibility and screen resolution problems, the author recommends an sdk for TV development, which is very easy to use.


Download

Command Line: git clone https://github.com/boxmate/tvframe.git

Or

OpenHttps://github.com/boxmate/tvframe, Download Zip in the lower right corner



The downloaded file contains two directories: frametv/framework project source code framedemo/DEMO sample project. import: 1. After the download is complete, Import two Projects, namely File-> Import-> Android-> Existing Projects Into Workspace; obtain the RecoTvFrame framework RecoTvFrameDemo demo of two projects. 2. Add RecoTvFrame as Library 1. right-click the RecoTvFrame framework project and click Properties 2 at the bottom. click the Android option on the left and select Is Library 3 in the lower right corner. click confirm 3. Introduce RecoTvFrame. We will use the demo project as an example. 1. right-click the demo project and click Properties 2 at the bottom. click the Android option on the left and Add 3 on the right. select RecoTvFrame to add, complete import operation 4. Process android-support-v4.jar conflict 1. remove the V4 package (in the libs/directory) from your project, and then copy the V4 package in the libs/directory of the framework to the corresponding directory of your project. right-click the V4 package and choose Build Path> Add To Build Path 5. Run the Demo project (or your own project)


The landlord used this sdk to develop a helloword


Very simple

The Code is as follows:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools/"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:paddingBottom="@dimen/activity_vertical_margin"    android:paddingLeft="@dimen/activity_horizontal_margin"    android:paddingRight="@dimen/activity_horizontal_margin"    android:paddingTop="@dimen/activity_vertical_margin"    tools:context=".MainActivity" >    <reco.frame.tv.view.TvButton         android:layout_width="@dimen/px100"        android:layout_height="@dimen/px100"        android:layout_marginLeft="@dimen/px100"        android:layout_marginTop="@dimen/px200"        android:background="#ff0000"        android:text="H"        />    <reco.frame.tv.view.TvButton         android:layout_width="@dimen/px100"        android:layout_height="@dimen/px100"        android:layout_marginLeft="@dimen/px210"        android:layout_marginTop="@dimen/px200"        android:background="#ff0000"        android:text="E"        />    <reco.frame.tv.view.TvButton         android:layout_width="@dimen/px100"        android:layout_height="@dimen/px100"        android:layout_marginLeft="@dimen/px320"        android:layout_marginTop="@dimen/px200"        android:background="#ff0000"        android:text="L"        />    <reco.frame.tv.view.TvButton         android:layout_width="@dimen/px100"        android:layout_height="@dimen/px100"        android:layout_marginLeft="@dimen/px430"        android:layout_marginTop="@dimen/px200"        android:background="#ff0000"        android:text="L"        /><reco.frame.tv.view.TvButton         android:layout_width="@dimen/px100"        android:layout_height="@dimen/px100"        android:layout_marginLeft="@dimen/px540"        android:layout_marginTop="@dimen/px200"        android:background="#ff0000"        android:text="O"        /><reco.frame.tv.view.TvButton         android:layout_width="@dimen/px100"        android:layout_height="@dimen/px100"        android:layout_marginLeft="@dimen/px100"        android:layout_marginTop="@dimen/px400"        android:background="#00ff00"        android:text="W"        />    <reco.frame.tv.view.TvButton         android:layout_width="@dimen/px100"        android:layout_height="@dimen/px100"        android:layout_marginLeft="@dimen/px210"        android:layout_marginTop="@dimen/px400"        android:background="#00ff00"        android:text="O"        />    <reco.frame.tv.view.TvButton         android:layout_width="@dimen/px100"        android:layout_height="@dimen/px100"        android:layout_marginLeft="@dimen/px320"        android:layout_marginTop="@dimen/px400"        android:background="#00ff00"        android:text="R"        />    <reco.frame.tv.view.TvButton         android:layout_width="@dimen/px100"        android:layout_height="@dimen/px100"        android:layout_marginLeft="@dimen/px430"        android:layout_marginTop="@dimen/px400"        android:background="#00ff00"        android:text="L"        /><reco.frame.tv.view.TvButton         android:layout_width="@dimen/px100"        android:layout_height="@dimen/px100"        android:layout_marginLeft="@dimen/px540"        android:layout_marginTop="@dimen/px400"        android:background="#00ff00"        android:text="D"        />    </RelativeLayout>


Is a simple activity, and then use the tvbutton control in the sdk


Then there is a focal point amplification effect,


There are a lot of cases in the sdk demo. You can study it one by one. Basically, developing a TV application is no big problem.


Official framework homepage: Click to open the link

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.