Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
android
/
dayu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2ddc4ae6
authored
Dec 18, 2018
by
罗翻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试aidl
parent
a2566532
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
0 deletions
app/src/main/aidl/com/dayu/bigfish/IRomteService.aidl
app/src/main/aidl/com/dayu/bigfish/api/protocol/Book.aidl
app/src/main/java/com/dayu/bigfish/api/protocol/Book.java
app/src/main/aidl/com/dayu/bigfish/IRomteService.aidl
0 → 100644
View file @
2ddc4ae6
//
IRomteService
.
aidl
package
com
.
dayu
.
bigfish
;
//
Declare
any
non
-
default
types
here
with
import
statements
import
com
.
dayu
.
bigfish
.
api
.
protocol
.
Book
;
interface
IRomteService
{
/**
*
获取图书列表
*/
List
<
Book
>
getBookList
();
/**
*
添加图书
*/
void
addBook
(
in
Book
book
);
String
add
();
}
app/src/main/aidl/com/dayu/bigfish/api/protocol/Book.aidl
0 → 100644
View file @
2ddc4ae6
//
Person
.
aidl
package
com
.
dayu
.
bigfish
.
api
.
protocol
;
//
Declare
any
non
-
default
types
here
with
import
statements
parcelable
Book
;
app/src/main/java/com/dayu/bigfish/api/protocol/Book.java
0 → 100644
View file @
2ddc4ae6
package
com
.
dayu
.
bigfish
.
api
.
protocol
;
import
android.os.Parcel
;
import
android.os.Parcelable
;
/**
* Created by znh on 2018/6/10.
* <p>
* 封装图书信息的Book类
*/
public
class
Book
implements
Parcelable
{
//图书ID
public
int
bookId
;
//图书名称
public
String
bookName
;
public
Book
(
int
bookId
,
String
bookName
)
{
this
.
bookId
=
bookId
;
this
.
bookName
=
bookName
;
}
private
Book
(
Parcel
source
)
{
bookId
=
source
.
readInt
();
bookName
=
source
.
readString
();
}
public
static
final
Creator
<
Book
>
CREATOR
=
new
Creator
<
Book
>()
{
@Override
public
Book
createFromParcel
(
Parcel
in
)
{
return
new
Book
(
in
);
}
@Override
public
Book
[]
newArray
(
int
size
)
{
return
new
Book
[
size
];
}
};
@Override
public
int
describeContents
()
{
return
0
;
}
@Override
public
void
writeToParcel
(
Parcel
dest
,
int
flags
)
{
dest
.
writeInt
(
bookId
);
dest
.
writeString
(
bookName
);
}
@Override
public
String
toString
()
{
return
"Book{"
+
"bookId="
+
bookId
+
", bookName='"
+
bookName
+
'\''
+
'}'
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment