开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
master
分支 (1)
master
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
贡献代码
同步代码
对比差异 通过 Pull Request 同步
同步更新到分支
通过 Pull Request 同步
将会在向当前分支创建一个 Pull
Request,合入后将完成同步
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
未知许可证
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################
######### CONTENTS ###########
A. INTRODUCTION
B. PLUGIN STRUCTURE
C. HOW TO DEPLOY
D. SUB-PLUGINS
 1. ANIMATION
 2. AUDIO
 3. BACKGROUND
 4. FORM
 5. PAINT
##############################
## (A) INTRODUCTION ##########
The sample plugin is intended to give plugin developers a point of reference to
see how an android browser plugin is created and how to use the available APIs.
A plugin is packaged like a standard apk and can be installed either via the 
market or adb. The sample plugin attempts to exercise as many of the APIs as
possible but unfortunately not all are covered. 
Trying to have a single plugin demonstrate all possible API interactions on one
screen was not practical. On the other hand we also didn't want a separate
plugin for each interction, as that would result in many separate apk's that
would need to be maintained. To solve this problem we developed the idea to use
"sub-plugins". With a sub-plugin only one specific feature of the plugin would
be active at a time, but they would all share as much common code as possible.
A detailed description of each sub-plugin and its function can be found in the
sub-plugins section.
##############################
## (B) PLUGIN STRUCTURE ######
The sample plugin is packaged as one plugin but contains many unique sub-plugins
(e.g. audio and paint). The package consists of two pieces: (1) Java code
containing the config; (2) C++ shared library containing the brower/plugin
bindings and the sub-plugin classes. 
~~~~ (1) JAVA ~~~~~
Android.mk: specifies the name of the APK (SampleBrowserPlugin) as well as which
 shared libraries to include.
AndroidManifest.xml: similar to a standard android manifest file, except that it
 must contain the "uses-permission" and "service"
 elements that are plugin specific. The "service" element
 contains sub-elements that describe the java component of
 the service.
src/*: location of the java source files. This contains the SamplePlugin.class
 which is the java component of our plugin. The component must exist and
 implement the required interfaces, though simply returning null is valid.
res/*: location of the static resources (e.g. an icon for the plugin)
~~~~ (2) C++ ~~~~~
jni/Android.mk: specifies the build parameters for the shared library that is to
 be included with the apk. The library contains all the bindings
 between the plugin and the browser.
jni/main.*: this code is the binding point between the plugin and the browser.
 It supports all of the functions required for a standard netscape
 style plugin as well as all the android specific APIs. The initial
 starting point for the plugin is the NP_Initialize function. The
 NPP_New function is responsible for reading the input args and
 selecting the appropriate sub-plugin to instantiate. Most other
 functions either return fixed values or pass their inputs to the
 sub-plugin for processing.
jni/PluginObject.*: The pluginObject provides a convenient container in which to
 store variables (the plugin's state). This objects two main
 responsibilities are (1) to construct and store the NPClass 
 object (done using code provided by Apple) and (2) provide
 the abstract class for the sub-plugin objects and a place to 
 store the sub-plugin after it is instantiated. 
jni/*/*: Each of the sub-plugins has a folder that contains its class definition
 and logic. The sub-plugin receives events from the browser and it can
 also communicate with the browser using the netscape plugin functions
 as well as the specialized android interfaces.
##############################
## (C) HOW TO DEPLOY #########
To compile and install a plugin on a device/emulator simply...
1. run "make SampleBrowserPlugin" (compiles libsampleplugin.so and builds the apk)
2. the previous command produces an apk file so record its location
3. run "adb install [apk_file]" to install it on a device/emulator
4. the browser will auto recognize the plugin is available
Now that the plugin is installed you can manage it just like you would any other
application via Settings -> Applications -> Manage applications. To execute the
plugin you need to include an html snippet (similar to the one found below) in
a document that is accessible by the browser. The mime-type cannot change but
you can change the width, height, and parameters. The parameters are used to
notify the plugin which sub-plugin to execute and which drawing model to use.
<object type="application/x-testbrowserplugin" height=50 width=250>
 <param name="DrawingModel" value="Surface" />
 <param name="PluginType" value="Background" />
</object>
##############################
## (D) SUB-PLUGINS ###########
Each sub-plugin corresponds to exactly one plugin type and can support one or
more drawing models. In the subsections below there are descriptions of each of
the sub-plugins as well as the information required to create the html snippets. 
#######################
## (D1) ANIMATION #####
PLUGIN TYPE: Animation
DRAWING MODEL: Bitmap
This plugin draws a ball bouncing around the screen. If the plugin is not entirely
on the screen and it it touched, then it will attempt to center itself on screen.
#######################
## (D2) AUDIO #########
PLUGIN TYPE: Audio
DRAWING MODEL: Bitmap
This plugin plays a raw audio file located at /sdcard/sdample.raw (need to supply
your own). It uses touch to trigger the play, pause, and stop buttons.
#######################
## (D3) BACKGROUND ####
PLUGIN TYPE: Background
DRAWING MODEL: Surface
This plugin has minimal visual components but mainly runs API tests in the 
background. The plugin handles scaling its own bitmap on zoom which in this
case is a simple string of text. The output of this plugin is found in the logs
as it prints errors if it detects any API failures. Some of the API's tested are
timers, javascript access, and bitmap formatting.
#######################
## (D4) FORM ##########
PLUGIN TYPE: Form
DRAWING MODEL: Bitmap
This plugin mimics a simple username/password form. You can select a textbox by
either touching it or using the navigation keys. Once selected the box will
highlight and the keyboard will appear. If the textbox selected is not fully
in view then the plugin will ensure it is centered on the screen. 
#######################
## (D5) PAINT #########
PLUGIN TYPE: Paint
DRAWING MODEL: Surface
This plugin provides a surface that the user can "paint" on. The inputs method
can be toggled between mouse (dots) and touch (lines). This plugin has a fixed
surface and allows the browser to scale the surface when zooming.
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

暂无描述
暂无标签
README
未知许可证
查看未知开源许可协议
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Android
1
https://gitee.com/zlstold/AndroidBrowserPlugin.git
git@gitee.com:zlstold/AndroidBrowserPlugin.git
zlstold
AndroidBrowserPlugin
AndroidBrowserPlugin
master
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /