实现Android手机音乐应用【中文4540字】
收藏
资源目录
编号:6099460
类型:共享资源
大小:1.72MB
格式:RAR
上传时间:2017-11-16
上传人:闰***
认证信息
个人认证
冯**(实名认证)
河南
IP属地:河南
13
积分
- 关 键 词:
-
实现
android
手机
音乐
应用
利用
运用
中文
- 资源描述:
-
实现Android手机音乐应用【中文4540字】,实现,android,手机,音乐,应用,利用,运用,中文
- 内容简介:
-
A Novel approach for streaming music to Android phone through Global IP using DAAPVishal A. Kamble; Annasaheb Dange College of Engineering and Technology; Dept of Computer Science; Ashta, India.Amol S. Dange; Annasaheb Dange College of Engineering and Technology; Dept of Computer Science; Ashta, India.Sachin P. Yadav; Annasaheb Dange College of Engineering and Technology; Dept of Computer Science; Ashta, India.ABSTRACT Android platform is new generation of smart mobile phone platform launched by Google in 2007.Android provides support to music streaming, which is probably a concern of vast number of developers. So as the development of music streaming to Android phone is concern its need an http streams to stream music to Android phone. Android is an open sources and providing an easy to use development kit. This paper introduce you the Architecture and components of Android and analyzes the anatomy of Android application including the functions of Activity, Intent Receiver, Services, Content Provider, and etc. Based on Android the application Music On Demand (MOD) is developed to dedicated to make it easier for people to access and enjoy their digital music whenever and wherever they want. This software connects people directly with their content, without the hassles of synching or uploading all their files. Music on Demands users can also share their personal media with family and friends in a private, secure group. Music from shared libraries is streamed on demand in real time.MOD leverages the implementation of Digital Audio Access Protocol (DAAP). Rhythm Box shares the music library on LAN and we tunnel the DAAP packets over Internet to the servers shared library.INTRODUCTION Android is a software stack for mobile devices that include an operating system, middleware and key application. The Open Handset Alliance (OHA) released the Google Android SDK on November 12, 2007 1. The Android SDK provides the tools and APIs necessary to begin developing application on the Android platform using Java programming language. Android platform is of open system architecture, with versatile development and debugging environment, but also supports a variety of scalable user experience, which has optimized graphics systems, rich media support and a very powerful browser. It enables reuse and replacement of components and an efficient database support and support various wireless communication means. It uses a Dalvik virtual machine heavily optimized for mobile devices 2. The Various feature of Android are as fallow, Android have its own browser based on open source WebKit engine. It has various hardware dependent feature lke GSM, Bluetooth, EDGE, 3G, WiFi, Camera etc. It has media support for Common audio, video, and still image formats (MPEG4,H.264,MP3,AAC,AMR,JPG,PNG,GIF) As the Android support the Wi-Fi and various audio format user can flexibly access and control the streaming of music from a Global IP. The Android architecture and anatomy of Android application are addressed in Section II and III. Based on the analyses, the design of Streaming application to stream music from remote desktop machine to Android phone is then presented in section IV and the last section gives the conclusion and various references.ANDROID ARCHITECTUREFigure 1 Android architectureThe Android architecture and its main components are shown in above Figure 1.Application LayerAndroid will ship with a set of core applications including an email client, SMS program, calendar, maps, browser, contacts, and others even the application, which will be described in Section IV is in application layer. All applications are written using the Java programming language.Application FrameworkThe application framework provides the classes used to create Android applications. It also provides a generic abstraction for hardware access and manages the user interface and application resources. Developers have the full access to same framework APIs used by the core application. LibrariesRunning on top of the kernel, Android includes various CC+ core libraries such as libc and SSL as well as, A media library for playback of audio and video. A surface manager to provide display management, Graphics libraries that include SGL and OpenGL for 2D and 3D graphics, SQLite for native database support, SSL and WebKit for integrated web browser and internet security.Android RuntimeAndroid includes a set of core libraries that provides most of functionality available in the core libraries of the Java programming language. Every Android application runs in its own process, with its own instance of the Dalvik virtual machine. Dalvik has been written so that a device can run mobile VMs efficiently. The Dalvik VM executes files in the Dalvik Executable (.dex) format which is optimized for minimal memory footprint. The VM is register-based, and runs classes complied by Java language complier that have been transformed into the .dex format by the included “dx” tool. The Dalvik VM relies on the Linux kernel for underlying functionality such as threading and low-level memory management. Linux KernelCore services (including hardware drivers, process and memory management, security, network, and power management) are handled by a Linux 2.6 kernel. The kernel also provides an abstraction layer between the hardware and the remainder of the stack. ANATOMY OF ANDROID APPLICATIONThere are four building blocks to an Android application: Activity, Intent Receiver, Service, and Content Provider Not Every application needs to have all four, but user application will be written with some combination of these. Once user has decided what components he need for his application, he should list them in a file called AndroidManifest.xml. This is an XML file where user declares the components of user application and what their capabilities and requirements are24. ActivityActivities are the most common of the four Android building blocks. An activity is usually a single screen in your application. Each activity is implemented as a single class that extends the Activity base class. Your class will display a user interface composed of Views and respond to events. Most applications consist of multiple screens. For example, a text messaging application might have one screen that shows a list of contacts to send messages to, a second screen to write the message to the chosen contact, and other screens to review old messages or change settings. Each of these screens would be implemented as an activity. Moving to another screen is accomplished by a starting a new activity. In some cases an Activity may return a value to the previous activity - for example an activity that lets the user pick a photo would return the chosen photo to the caller. When a new screen opens, the previous screen is paused and put onto a history stack. The user can navigate backward through previously opened screens in the history. Screens can also choose to be removed from the history stack when it would be inappropriate for them to remain. Android retains history stacks for each application launched from the home screen.Intent Receiver Android uses a special class called Intent to move from screen to screen. Intent describes what an application wants done. The two most important parts of the Intent data structure are the action and the data to act upon. Typical values for action are MAIN (the front door of the application), VIEW, PICK, EDIT, etc. The data is expressed as a Uniform Resource Indicator (URI). For example, to view a website in the browser, you would create Intent with the VIEW action and the data set to a Website-URI.NewIntent(Android.content.Intent.VIEW_ACTION,ContentURI.create(); There is a related class called an IntentFilter.While an Intent is effectively a request to do something, an Intent filter is a description of what Intents an activity (or Intent receiver, see below) is capable of handling. An activity that is able to display contact information for a person would publish an IntentFilter that said that it knows how to handle the action VIEW when applied to data representing a person. Activities publish their IntentFilters in the AndroidManifest.xml file. Navigating from screen to screen is accomplished by resolving Intents. To navigate forward, an activity calls startActivity(myIntent). The system then looks at the Intent filters for all installed applications and picks the activity whose Intent filters best matches myIntent. The new activity is informed of the Intent, which causes it to be launched. The process of resolving Intents happens at run time when startActivity is called. You can use an Intent Receiver when you want code in your application to execute in reaction to an external event, for example, when the phone rings, or when the data network is available, or when its midnight. Intent receivers do not display a UI, although they may display Notifications to alert the user if something interesting has happened. Intent receivers are also registered in AndroidManifest.xml, but you can also register them from code using Context.registerReceiver(). Your application does not have to be running for its Intent receivers to be called; the system will start your application, if necessary, when an Intent receiver is triggered. Applications can also send their own Intent broadcasts to others with Context.broadcastIntent(). Service A Service is code that is long-lived and runs without a UI. A good example of this is a media player playing songs from a play list. In a media player application, there would probably be one or more activities that allow the user to choose songs and start playing them. However, the music playback itself should not be handled by an activity because the user will expect the music to keep playing even after navigating to a new screen. In this case, the media player activity could start a service using Context.startService() to run in the background to keep the music going. The system will then keep the music playback service running until it has finished. (You can learn more about the priority given to services in the system by reading Life Cycle of an Android Application.) Note that you can connect to a service (and start it if its not already running) with the Context.bindService() method. When connected to a service, you can communicate with it through an interface exposed by the service. For the music service, this might allow you to pause, rewind, etc. Content Provider Applications can store their data in files, a SQLite database, preferences or any other mechanism that makes sense. A content provider, however, is useful if you want your applications data to be shared with other applications. A content provider is a class that implements a standard set of methods to let other applications store and retrieve the type of data that is handled by that content provider. MUSIC ON DEMANDSTREAMING APPLICATION FOR ANDROIDIn present available schemes, people take on and off their music collection from phone memory, which is really a hectic and tedious job. To overcome this and to get user what he wants to listen and tap his feet on music, this application is implemented 356 .With this system, user will be able to share the media files from anywhere (Desktops/Laptops).To do so, what user needs is just an Internet connection, which is common these days. User will be able to share the media without actually sharing the files publicly. The requesting clients will be able to play the media from their workstation or Android Phone without actually copying the files to their system. Proper user profiling is done and friend list of the users is maintained to get access of the respective shared media. Whenever a user requests for a track, it will be fetched from the system on which it is shared under the authenticated users account and then streamed back to the requesting client. So the server need not have exceptionally large data storage space. There are three main components of this system- Desktop Client Interface The application interface for the client machine, which is designed for the sole purpose of communicating with the server. It is acting as mediator between the media player and the server. The user is able to create his/her private account through this interface. This interface will also carry out the task of streaming the audio files through internet. The streaming protocol is actually working between this interface and server.Figure 2 Interface for communicating between Rhythm boplayer and Server.Android Client The similar interface on the Android mobile platform. The user is not able to share the media from the Android phone. The interface will just receive the streamed media and play it using the media player on the Android mobile. The files will be played sequentially from the list of shared files. The user can demand any audio file randomly. The file will be streamed and played simultaneously.Figure 3 Android applications for streaming music and to get the list of shared music libraryThe Server It performs two major operations, fetching from one client, streaming it to another and storing references of the entire music track shared by the user from desktop client. The server will have a Global IP through which all the communication will take place.Figure 4 System ArchitectureThe above shown figure gives the detail view of music on demand system for Android. As shown and explain above it is divided into three main component Client, Server and Android phone application. The detail of how actual communication between the three components takes place is explained further. Flow of messages between Desktop Client Interface and Rhythmbox Media Player (We are using libopendaap library/API for communicating with the rhythmbox DAAP share)3 .1. First create a DAAP client which will identify the local DAAP share. 2. Then connect to the local DAAP share ignoring all other DAAP shares from local network. 3. The DAAP requests made to the local Rhythm box player are as follows: Client Rhythmbox Description -/server-info- Request for server info request for content-codes login update request database request request songs request playlists .mp3- request mp3 Packet for round trip time outLogin packet for auth. Local machine description List of songs (10 songs/packet) song reply Actual stream of the song Round trip time out calculation Login packet for authentication Request for shared libraries Request for songs Song request (with song-id) -strp- Stream reply (with path for HTTP streaming)Figure 5 Result of streaming music to Android fromDesktop client throughWe can see from the above figure that the implementation of streaming application to Android through global IP using DAAP and Rhythmbox is convenient CONCLUSION We love a variety of music and of course, we have 4000+ song collection, which we cannot fit on our Android Phone. Neither can our friends library, however, Music On Demand takes you to your friends song collections wherever you
- 温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

人人文库网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。