반응형

 

아래 제시한 내용을 테스트해보니 제대로 동작하지 않는 것 같습니다.

혹시 앱인벤터 백그라운드 앱에 대한 정보를 아시는 분은 댓글 부탁드립니다.


 

Introduction to  Background Services and Tasks in App Inventor

DRAFT, February 15, 2016

 

Introduction to  Background Services and Tasks in App Inventor

What are services?

Note

Caveats

Tasks

New Components

The Reminder Tutorial

 

 

Learning Goals:

  • Learn about Android services
  • Learn about tasks in App Inventor
  • Learn about the components that can be used with tasks

 

 

      

 

What are services?

 

  Services (also called “background services”) are features of mobile apps that let apps do work even when they are not showing on the screen.  For example, a phone alarm can keep track of time and alert you, or a music app can play, even when another app is running.   If you don’t include services in your app, then you’ll have to leave your app open if you want it to do something. Imagine if you had to leave your alarm app open all night long in order for it to keep time.   Or if your music app could not play while you were using the phone for anything else.  That would be terribly limited.   Including services in your apps broadens the types of apps you can make.

        Luckily, App Inventor has features for building apps that use services.  This tutorial shows how to get started by showing how to create a simple Reminder app that posts notifications at specified time intervals, even if the app is not on the screen.

 

Note

 

App Inventor services were designed as part of an MIT Masters thesis by Veda Sayyaparaju.  The completed implementation, together with the Reminder tutorial and others, are part of MIT undergraduate research by Emily Giurleo.  

 

Caveats

 

This is an early testing release of App Inventor services.   Please experiment with it and send us your comments, but keep in mind that there are a few important limitations:

  • The current version of App Inventor services requires Android devices running at least API level ??

 

  • Services are still an experimental feature that is not yet part of the MIT App Inventor system.   To experiment with them, use the test server at services.appinventor.mit.edu rather than the main MIT App Inventor service.

 

  • You can download the companion from here.  The companion will need to be updated regularly, since the Services feature is under development.

 

  • App that have tasks  do not yet work in live development.   When you connect the companion, you’ll find that you can do live development with the screens of the apps, but not the tasks.  For now, you’ll need to test your app by building it and installing the APK on the device.

 

  • An application can currently have at most one task.

 

  • Tasks that do a lot of computing will drain your battery pretty quickly.

 

Tasks

 

Tasks are a feature in App Inventor that allow you to add services to your apps. They are similar to screens -- you create them in the App Inventor designer and add components in much same way as you create  -- but tasks have no visible components, so you won’t be able to add buttons or images. Tasks do things only “behind the scenes.”

        You can create a new task by going to the topmost toolbar in App Inventor and clicking the “Add Task…” button.  Just as with adding a new screen, you can name your new task, and it display in the left-most dropdown menu, which lists the screens and tasks in you application. If you select  a task, from the dropdown, you’ll see that it has Designer and Block modes, just like a screen.   You can use Designer to add non-visible components such as Clock or TinyDB, and then you can the Blocks editors to specify the behavior of the task. 

 

New Components

 

        Tasks in App Inventor wouldn’t be complete without some really important components:

NotificationComponent is a non-visible component that lets a task launch notifications on your cell phone. Tasks don’t have visible screens of their own.  They use notifications to let the user know when something has happened.   A notification appears as an indicator in the “notification area” at the top of the phone screen.  Users can scroll that area down to see the details of the notifications.

The other key component for services is the ApplicationMessenger component. This non-visible component lets your app send messages between its screens and tasks, so that your app can update its screen based on information from the task.

These two components can be found under the “Sensors” section of the components drawer, on the left-hand side of your screen.  



The Reminder Tutorial

 

You’ll see how to use tasks and the two components in the three parts of this tutorial, which shows you how to create an app that sends reminders, even when it is running background:

 

 

When you’re finished, you’ll be ready to create your original apps with services.

 

 

<출처: https://docs.google.com/document/d/1F_gTwu_PgKiYw5FJccZb4zz_YDr_haFqvuxKhnAjBj8/mobilebasic?pli=1 >

 

<이상> 

 

 

반응형

+ Recent posts