Public-oriented mobile technology: Signature, encapsulation and release of Android apps

Source: Internet
Author: User

Public-oriented mobile technology: Signature, encapsulation and release of Android apps

Add the addresses of the other four articles for the big slave mobile piling ):

1) Introduction to android;

2) gently draw and encode the gesture in android;

3) Activities and icons in the lifecycle of Android applications;

4) Overheard Word and gesture.

Add a multi-choice quiz to your Android app, and then sign it with a secure digital certificate.

The network logic is used. The content is king. But for mobile users, interaction rules are king. Static information design for mobile apps is decreasing, And gamification is increasing. This month, Andrew Glover decided to add a multi-choice quiz feature to an example appOverheard Word, which was introduced in the previous article .) To introduce Android mobile development. Then he will show you how to generate a digital certificate and how to publish it and how to upgrade your signed app on Google Play or Amazon Appstore.

So far in this Mobil for the masses series, we have used Android as an example to learn how to do mobile development, including the Android Application lifecycle tutorial, implement the gesture slide function in your Android apps. Work with third-party libraries to simplify development and enhance app capabilities. When I am not sure about Android, I am interested in browsing other mobile phone environments and technologies. So this month, we will add a quiz feature to the Overheard Word sample app to summarize our Android-intensive (enhanced Android) article and prepare to deploy it to two popular Adroid app stores: google Play and Amazon Appstore. All of these will be the foundation of the next section: HTML5 attacks mobile development!

Gamification my app

Before we signed Overheard Word and pushed it to Google Play and Amazon Appstore's Android Market to compete with its apps in the same millions, I want to confirm that it is the best Overheard Word app (not familiar with our Overheard Word app? Review this example ). As you know, games are currently the driving force behind the mobile ecosystem, and a series of apps are expected to have efficient interaction. Mobile apps do well even if they aim to provide information value, even mobile apps that ignite curiosity and desire to win. That's why Overheard Word is not just a list of words on a page. On the contrary, it is designed to inspire readers to explore their vocabulary, and then reward them to learn it! (By The Way, Gamification is a term that is becoming popular in design technology)
Before we signed Overheard Word and pushed it to Google Play and Amazon Appstore's Android Market to compete with millions of other apps, I want to confirm that it is the best Overheard Word app (not familiar with our Overheard Word app? Review this example ). As you know, games are currently the driving force behind the mobile ecosystem, and a series of apps are expected to have efficient interaction. Mobile apps do well even if they aim to provide information value, even mobile apps that ignite curiosity and desire to win. That's why Overheard Word is not just a list of words on a page. On the contrary, it is designed to inspire readers to explore their vocabulary, and then reward them to learn it! (By The Way, Gamification is a term that is becoming popular in design technology)
Before we signed Overheard Word and pushed it to Google Play and Amazon Appstore's Android Market to compete with millions of other apps, I want to confirm that it is the best Overheard Word app (not familiar with our Overheard Word app? Review this example ). As you know, games are currently the driving force behind the mobile ecosystem, and a series of apps are expected to have efficient interaction. Mobile apps do well even if they aim to provide information value, even mobile apps that ignite curiosity and desire to win. That's why Overheard Word is not just a list of words on a page. On the contrary, it is designed to inspire readers to explore their vocabulary, and then reward them to learn it! (By The Way, Gamification is a term that is becoming popular in design technology)

Overheard Word Query

We will start a newly defined layout to make the Overheard Word test view consistent. Next we will define an Activity to display the layout. As mentioned above, I am using the Eclipse ADT as my development environment. I suppose you also use it.

We will start a newly defined layout to make the Overheard Word test view consistent. Next we will define an Activity to display the layout. As mentioned above, I am using the Eclipse ADT as my development environment. I suppose you also use it.

Figure 1. Creating a new layout in Eclipse

We will start a newly defined layout to make the Overheard Word test view consistent. Next we will define an Activity to display the layout. As mentioned above, I am using the Eclipse ADT as my development environment. I suppose you also use it.

Next, copy the following XML to your new file.

Listing 1. Quiz layout for Overheard Word

 
  1. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
  2.     xmlns:tools="http://schemas.android.com/tools" 
  3.     android:layout_width="match_parent" 
  4.     android:layout_height="match_parent" 
  5.     tools:context=".OverheardWord" > 
  6.  
  7.     <LinearLayout 
  8.         android:id="@+id/widget33" 
  9.         android:layout_width="fill_parent" 
  10.         android:layout_height="fill_parent" 
  11.         android:layout_marginLeft="20dp" 
  12.         android:orientation="vertical" > 
  13.  
  14.         <TextView 
  15.             android:id="@+id/quiz_definition" 
  16.             android:layout_width="wrap_content" 
  17.             android:layout_height="wrap_content" 
  18.             android:layout_marginBottom="20dp" 
  19.             android:layout_marginLeft="13dp" 
  20.             android:layout_marginRight="10dp" 
  21.             android:layout_marginTop="48dp" 
  22.             android:text="Definition" 
  23.             android:textSize="18sp" /> 
  24.  
  25.         <RadioGroup 
  26.             android:id="@+id/quiz_answers" 
  27.             android:layout_width="wrap_content" 
  28.             android:layout_height="wrap_content" 
  29.             android:layout_marginLeft="17dp" > 
  30.  
  31.             <RadioButton 
  32.                 android:id="@+id/quiz_answer_1" 
  33.                 android:layout_width="wrap_content" 
  34.                 android:layout_height="wrap_content" 
  35.                 android:text="Answer 1" /> 
  36.  
  37.             <RadioButton 
  38.                 android:id="@+id/quiz_answer_2" 
  39.                 android:layout_width="wrap_content" 
  40.                 android:layout_height="wrap_content" 
  41.                 android:text="Answer 2" /> 
  42.  
  43.             <RadioButton 
  44.                 android:id="@+id/quiz_answer_3" 
  45.                 android:layout_width="wrap_content" 
  46.                 android:layout_height="wrap_content" 
  47.                 android:text="Answer 3" /> 
  48.         </RadioGroup> 
  49.  
  50.         <TextView 
  51.             android:id="@+id/quiz_result" 
  52.             android:layout_width="wrap_content" 
  53.             android:layout_height="wrap_content" 
  54.             android:layout_marginBottom="10dp" 
  55.             android:layout_marginLeft="40dp" 
  56.             android:layout_marginTop="20dp" 
  57.             android:lines="2" 
  58.             android:text="Result" 
  59.             android:textSize="18sp" /> 
  60.  
  61.         <TextView 
  62.             android:id="@+id/quiz_number" 
  63.             android:layout_width="fill_parent" 
  64.             android:layout_height="wrap_content" 
  65.             android:layout_marginRight="10dp" 
  66.             android:layout_marginTop="30dp" 
  67.             android:gravity="right" 
  68.             android:text="1/10" /> 
  69.     </LinearLayout> 
  70.  
  71. </RelativeLayout> 

The layout file of Overheard Word defines the UI of the Learning Guide, which defines the sample text of a series of UI elements, the purpose is to get an idea about what things are like when your app goes online. The layout of this test includes a TextView that saves the detailed definition and a RadioGroup that fits the defined word. When you select a word, submit a new question, or try again, the app immediately notifies you of an event and corresponding counters that track the user process through this small test.

The next step is to create a new Activity class. This class should inherit the Activity class and provide an onCreate method, as shown in Listing2. Note: setContentView specifies the new layout File Created by Listing1)

Listing 2. New Activity class: OverheardQuiz

 
  1. import android.app.Activity; 
  2. import android.os.Bundle; 
  3.  
  4. public class OverheardQuiz extends Activity { 
  5.  
  6.  protected void onCreate(Bundle savedInstanceState) { 
  7.   super.onCreate(savedInstanceState); 
  8.   setContentView(R.layout.activity_overheard_quiz); 
  9.  } 
  10. } 

The next step is to create a new Activity, which will display the layout of Overheard word testing. Instead of creating an optional menu item, let's try to use the gesture slide function to start a test. Later, we will add the app menu to the test.

Intents Programming

As we discussed earlier, an Android device is extremely constrained by battery time cycles, execution capabilities, and memory. Most personal devices also have many apps like phone and text features, so they have multiple active programs running at the same time. The Android platform manages programs by putting your apps under certain constraints at any time as developers. For example, you cannot force an Activity class to start and display its view. Instead, you need to send the activity to the platform an intent to start. The Platform starts the Activity when it can start it.

Imagine an Intent is a mechanism for asynchronous task execution. From the user's point of view, you suggest that the platform do something and it does it immediately when it can do it.

So we can't just start our Activity. We need to wrap it in an Intent. Then Android starts the Activity for us. As we are starting a new test Activity with a gesture, we will insert the intent into a GestureDetector instance. In this series

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.