Cronet is Chromium's Networking stack packaged as a library. This sample app shows how to use the library.
It's a manual procedure to get the Cronet library into a project. To add the libraries to the sample, please follow the following steps:
- Go to [Cronet releases website] (https://console.cloud.google.com/storage/browser/chromium-cronet/android) and choose the latest release
- Navigate to chromium-cronet/android/releasenumber/Release/cronet
- Get .jar files
- Download cronet_api.jar, cronet_impl_common_java.jar and cronet_impl_native_java.jar
- Directly under the "app" directory of your project, create a "libs" directory. Use a shell command if you like, or use "File|New|Directory" from the menu. But note that you only get "Directory" as an option if you are in "Project" view, not "Android" view. "Project" models the local machine's filesystem, but Android is a virtual layout of files corresponding to the deployed hierarchy.
- Copy cronet_api.jar cronet_impl_common_java.jar and cronet_impl_native_java.jar under the libs directory
- Select the files at once
- Bring up the context menu and choose "Add as Library"
- Confirm "OK" at the "Add to module" dialog
- Update the app/build.gradle file matching the names of the libraries
- Get .so files
- Download .so files, currently located here
- Under "app/src/main" create a directory named "jniLibs"
- Copy armeabi and armeabi-v7a into jniLibs, which should contain only subdirectories, not directly a '.so' file. If you typically use an emulator, copy x64_64 folder into jniLibs folder as well
Copyright 2015 Google, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for
additional information regarding copyright ownership. The ASF licenses this
file to you 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.