windows下如何下载android源码

简介: 在网上找了好久都没有找到如何批量下载,只是找到有位通过角本执行来进行下载的。 试了一下在我机器上运行有问题,所以索性自己搞了一个出来。 首先根据官方的说法要下载git,这个无论如何是要下载的。 点击安装,安装完成后, 在盘符上建立文件夹,我建在E:\android src下 右键选择G...

在网上找了好久都没有找到如何批量下载,只是找到有位通过角本执行来进行下载的。

试了一下在我机器上运行有问题,所以索性自己搞了一个出来。

首先根据官方的说法要下载git,这个无论如何是要下载的。

点击安装,安装完成后,

img_590f23b4746d0277a084bcf572ea1f56.jpg

在盘符上建立文件夹,我建在E:\android src下

右键选择Git bash

弹出如下界面

img_59cbf4485f3c0d4001f2f76a9e1bfdfd.jpg

下面就是整理下载的过程了,如果只需要下载其中的一个包,那么就不需要做下面的操作了,如果想下载全部源码就需要做一下处理,因为windows下是没有repo的

进入下载页面

http://android.git.kernel.org/

如果只下载一个,只需要

git clone git://android.git.kernel.org/ + project path.

将后面的project path改为下面第一列的内容即可。

img_1ada721fcfa2051a9473ca1d9f1ab9c0.jpg

这样对应的需要的包就可以下载了。

如果想下载所有的源码

在下载页面里进行选择

将页面中文件列表中的内容选择出来,并且放到文本文件中

img_9db84eb845b15cfbbea9361bc918f5d1.jpg

把文件保存到androidURL.txt中

然后用程序来取出我们需要的信息

新建类ReplaceFile.java

img_1c53668bcee393edac0d7b3b3daff1ae.gif img_405b18b4b6584ae338e0f6ecaf736533.gif View Code
 
  
public class ReplaceFile {

/**
*
@param args
*/
public static void main(String[] args) {
String fileName
= " C:/androidURL.txt " ;
readFileByLines(fileName);
}

private static void readFileByLines(String fileName) {
List
< String > tmpList = new ArrayList < String > (); // 用来存放修改后的url
File file = new File(fileName);
BufferedReader reader
= null ;
try {
System.out.println(
" 以行为单位读取文件内容,一次读一整行: " );
reader
= new BufferedReader( new FileReader(file));
String tempString
= null ;
int line = 1 ;
// 一次读入一行,直到读入null为文件结束
while ((tempString = reader.readLine()) != null ) {
// 显示行号
String splitByStr = " .git " ;
int tmpI = tempString.indexOf(splitByStr);
if (tmpI >= 0 ) {
tempString
= tempString.substring( 0 ,
tempString.indexOf(
" .git " ));

String gitGet
= " git clone git://android.git.kernel.org/ " ;
// System.out.println("line " + line + ": " + gitGet
// + tempString + splitByStr);
System.out.println(gitGet + tempString + splitByStr);
tmpList.add(gitGet
+ tempString + splitByStr);
}

line
++ ;
}
reader.close();
}
catch (IOException e) {
e.printStackTrace();
}
finally {
if (reader != null ) {
try {
reader.close();
}
catch (IOException e1) {
}
}
}
}

}

取出得到的文件列表如下:

img_1c53668bcee393edac0d7b3b3daff1ae.gif img_405b18b4b6584ae338e0f6ecaf736533.gif View Code
 
  
git clone git: // android.git.kernel.org/device/common.git
git clone git: // android.git.kernel.org/device/google/accessory/arduino.git
git clone git: // android.git.kernel.org/device/google/accessory/demokit.git
git clone git: // android.git.kernel.org/device/htc/common.git
git clone git: // android.git.kernel.org/device/htc/dream-sapphire.git
git clone git: // android.git.kernel.org/device/htc/dream.git
git clone git: // android.git.kernel.org/device/htc/passion-common.git
git clone git: // android.git.kernel.org/device/htc/passion.git
git clone git: // android.git.kernel.org/device/htc/sapphire.git
git clone git: // android.git.kernel.org/device/sample.git
git clone git: // android.git.kernel.org/device/samsung/crespo.git
git clone git: // android.git.kernel.org/device/samsung/crespo4g.git
git clone git: // android.git.kernel.org/kernel/common.git
git clone git: // android.git.kernel.org/kernel/experimental.git
git clone git: // android.git.kernel.org/kernel/linux-2.6.git
git clone git: // android.git.kernel.org/kernel/lk.git
git clone git: // android.git.kernel.org/kernel/msm.git
git clone git: // android.git.kernel.org/kernel/omap.git
git clone git: // android.git.kernel.org/kernel/qemu.git
git clone git: // android.git.kernel.org/kernel/samsung.git
git clone git: // android.git.kernel.org/kernel/tegra.git
git clone git: // android.git.kernel.org/platform/bionic.git
git clone git: // android.git.kernel.org/platform/bootable/bootloader/legacy.git
git clone git: // android.git.kernel.org/platform/bootable/diskinstaller.git
git clone git: // android.git.kernel.org/platform/bootable/recovery.git
git clone git: // android.git.kernel.org/platform/bootloader/legacy.git
git clone git: // android.git.kernel.org/platform/build.git
git clone git: // android.git.kernel.org/platform/cts.git
git clone git: // android.git.kernel.org/platform/dalvik.git
git clone git: // android.git.kernel.org/platform/development.git
git clone git: // android.git.kernel.org/platform/external/aes.git
git clone git: // android.git.kernel.org/platform/external/alsa-lib.git
git clone git: // android.git.kernel.org/platform/external/alsa-utils.git
git clone git: // android.git.kernel.org/platform/external/apache-http.git
git clone git: // android.git.kernel.org/platform/external/apache-qp.git
git clone git: // android.git.kernel.org/platform/external/astl.git
git clone git: // android.git.kernel.org/platform/external/bison.git
git clone git: // android.git.kernel.org/platform/external/blktrace.git
git clone git: // android.git.kernel.org/platform/external/bluetooth/bluez.git
git clone git: // android.git.kernel.org/platform/external/bluetooth/glib.git
git clone git: // android.git.kernel.org/platform/external/bluetooth/hcidumb.git
git clone git: // android.git.kernel.org/platform/external/bluetooth/hcidump.git
git clone git: // android.git.kernel.org/platform/external/bluez.git
git clone git: // android.git.kernel.org/platform/external/bouncycastle.git
git clone git: // android.git.kernel.org/platform/external/bsdiff.git
git clone git: // android.git.kernel.org/platform/external/bzip2.git
git clone git: // android.git.kernel.org/platform/external/chromium.git
git clone git: // android.git.kernel.org/platform/external/clearsilver.git
git clone git: // android.git.kernel.org/platform/external/dbus.git
git clone git: // android.git.kernel.org/platform/external/dhcpcd.git
git clone git: // android.git.kernel.org/platform/external/dnsmasq.git
git clone git: // android.git.kernel.org/platform/external/dosfstools.git
git clone git: // android.git.kernel.org/platform/external/dropbear.git
git clone git: // android.git.kernel.org/platform/external/e2fsprogs.git
git clone git: // android.git.kernel.org/platform/external/easymock.git
git clone git: // android.git.kernel.org/platform/external/eglib.git
git clone git: // android.git.kernel.org/platform/external/elfcopy.git
git clone git: // android.git.kernel.org/platform/external/elfutils.git
git clone git: // android.git.kernel.org/platform/external/embunit.git
git clone git: // android.git.kernel.org/platform/external/emma.git
git clone git: // android.git.kernel.org/platform/external/esd.git
git clone git: // android.git.kernel.org/platform/external/expat.git
git clone git: // android.git.kernel.org/platform/external/fdlibm.git
git clone git: // android.git.kernel.org/platform/external/freetype.git
git clone git: // android.git.kernel.org/platform/external/fsck_msdos.git
git clone git: // android.git.kernel.org/platform/external/gdata.git
git clone git: // android.git.kernel.org/platform/external/genext2fs.git
git clone git: // android.git.kernel.org/platform/external/giflib.git
git clone git: // android.git.kernel.org/platform/external/googleclient.git
git clone git: // android.git.kernel.org/platform/external/grub.git
git clone git: // android.git.kernel.org/platform/external/gtest.git
git clone git: // android.git.kernel.org/platform/external/guava.git
git clone git: // android.git.kernel.org/platform/external/harfbuzz.git
git clone git: // android.git.kernel.org/platform/external/hcidump.git
git clone git: // android.git.kernel.org/platform/external/hyphenation.git
git clone git: // android.git.kernel.org/platform/external/icu4c.git
git clone git: // android.git.kernel.org/platform/external/iproute2.git
git clone git: // android.git.kernel.org/platform/external/ipsec-tools.git
git clone git: // android.git.kernel.org/platform/external/iptables.git
git clone git: // android.git.kernel.org/platform/external/jdiff.git
git clone git: // android.git.kernel.org/platform/external/jhead.git
git clone git: // android.git.kernel.org/platform/external/jpeg.git
git clone git: // android.git.kernel.org/platform/external/jsilver.git
git clone git: // android.git.kernel.org/platform/external/jsr305.git
git clone git: // android.git.kernel.org/platform/external/junit.git
git clone git: // android.git.kernel.org/platform/external/kernel-headers.git
git clone git: // android.git.kernel.org/platform/external/lcc.git
git clone git: // android.git.kernel.org/platform/external/libffi.git
git clone git: // android.git.kernel.org/platform/external/libgsm.git
git clone git: // android.git.kernel.org/platform/external/libnfc-nxp.git
git clone git: // android.git.kernel.org/platform/external/libpcap.git
git clone git: // android.git.kernel.org/platform/external/libpng.git
git clone git: // android.git.kernel.org/platform/external/libvpx.git
git clone git: // android.git.kernel.org/platform/external/libxml2.git
git clone git: // android.git.kernel.org/platform/external/libxslt.git
git clone git: // android.git.kernel.org/platform/external/mtd-utils.git
git clone git: // android.git.kernel.org/platform/external/mtpd.git
git clone git: // android.git.kernel.org/platform/external/netcat.git
git clone git: // android.git.kernel.org/platform/external/netperf.git
git clone git: // android.git.kernel.org/platform/external/neven.git
git clone git: // android.git.kernel.org/platform/external/nist-sip.git
git clone git: // android.git.kernel.org/platform/external/oauth.git
git clone git: // android.git.kernel.org/platform/external/opencore.git
git clone git: // android.git.kernel.org/platform/external/openssl.git
git clone git: // android.git.kernel.org/platform/external/openvpn.git
git clone git: // android.git.kernel.org/platform/external/oprofile.git
git clone git: // android.git.kernel.org/platform/external/ping.git
git clone git: // android.git.kernel.org/platform/external/ppp.git
git clone git: // android.git.kernel.org/platform/external/proguard.git
git clone git: // android.git.kernel.org/platform/external/protobuf.git
git clone git: // android.git.kernel.org/platform/external/qemu-pc-bios.git
git clone git: // android.git.kernel.org/platform/external/qemu.git
git clone git: // android.git.kernel.org/platform/external/quake.git
git clone git: // android.git.kernel.org/platform/external/safe-iop.git
git clone git: // android.git.kernel.org/platform/external/skia.git
git clone git: // android.git.kernel.org/platform/external/sonivox.git
git clone git: // android.git.kernel.org/platform/external/speex.git
git clone git: // android.git.kernel.org/platform/external/sqlite.git
git clone git: // android.git.kernel.org/platform/external/srec.git
git clone git: // android.git.kernel.org/platform/external/stlport.git
git clone git: // android.git.kernel.org/platform/external/strace.git
git clone git: // android.git.kernel.org/platform/external/svox.git
git clone git: // android.git.kernel.org/platform/external/tagsoup.git
git clone git: // android.git.kernel.org/platform/external/tcpdump.git
git clone git: // android.git.kernel.org/platform/external/tesseract.git
git clone git: // android.git.kernel.org/platform/external/tinyxml.git
git clone git: // android.git.kernel.org/platform/external/tremolo.git
git clone git: // android.git.kernel.org/platform/external/tremor.git
git clone git: // android.git.kernel.org/platform/external/v8.git
git clone git: // android.git.kernel.org/platform/external/webkit.git
git clone git: // android.git.kernel.org/platform/external/webp.git
git clone git: // android.git.kernel.org/platform/external/wpa_supplicant.git
git clone git: // android.git.kernel.org/platform/external/wpa_supplicant_6.git
git clone git: // android.git.kernel.org/platform/external/xdelta3.git
git clone git: // android.git.kernel.org/platform/external/xmlwriter.git
git clone git: // android.git.kernel.org/platform/external/yaffs2.git
git clone git: // android.git.kernel.org/platform/external/zlib.git
git clone git: // android.git.kernel.org/platform/frameworks/base.git
git clone git: // android.git.kernel.org/platform/frameworks/ex.git
git clone git: // android.git.kernel.org/platform/frameworks/opt/carddav.git
git clone git: // android.git.kernel.org/platform/frameworks/opt/com.google.android.git
git clone git: // android.git.kernel.org/platform/frameworks/opt/com.google.android.googlelogin.git
git clone git: // android.git.kernel.org/platform/frameworks/opt/emoji.git
git clone git: // android.git.kernel.org/platform/frameworks/policies/base.git
git clone git: // android.git.kernel.org/platform/hardware/alsa_sound.git
git clone git: // android.git.kernel.org/platform/hardware/broadcom/wlan.git
git clone git: // android.git.kernel.org/platform/hardware/htc/dream.git
git clone git: // android.git.kernel.org/platform/hardware/libhardware.git
git clone git: // android.git.kernel.org/platform/hardware/libhardware_legacy.git
git clone git: // android.git.kernel.org/platform/hardware/msm7k.git
git clone git: // android.git.kernel.org/platform/hardware/qcom/gps.git
git clone git: // android.git.kernel.org/platform/hardware/qcom/media.git
git clone git: // android.git.kernel.org/platform/hardware/ril.git
git clone git: // android.git.kernel.org/platform/hardware/ti/omap3.git
git clone git: // android.git.kernel.org/platform/hardware/ti/wlan.git
git clone git: // android.git.kernel.org/platform/libcore.git
git clone git: // android.git.kernel.org/platform/manifest.git
git clone git: // android.git.kernel.org/platform/ndk.git
git clone git: // android.git.kernel.org/platform/packages/apps/AccountsAndSyncSettings.git
git clone git: // android.git.kernel.org/platform/packages/apps/AlarmClock.git
git clone git: // android.git.kernel.org/platform/packages/apps/Bluetooth.git
git clone git: // android.git.kernel.org/platform/packages/apps/Browser.git
git clone git: // android.git.kernel.org/platform/packages/apps/Calculator.git
git clone git: // android.git.kernel.org/platform/packages/apps/Calendar.git
git clone git: // android.git.kernel.org/platform/packages/apps/Camera.git
git clone git: // android.git.kernel.org/platform/packages/apps/CertInstaller.git
git clone git: // android.git.kernel.org/platform/packages/apps/Contacts.git
git clone git: // android.git.kernel.org/platform/packages/apps/DeskClock.git
git clone git: // android.git.kernel.org/platform/packages/apps/Email.git
git clone git: // android.git.kernel.org/platform/packages/apps/Gallery.git
git clone git: // android.git.kernel.org/platform/packages/apps/Gallery3D.git
git clone git: // android.git.kernel.org/platform/packages/apps/GlobalSearch.git
git clone git: // android.git.kernel.org/platform/packages/apps/GoogleSearch.git
git clone git: // android.git.kernel.org/platform/packages/apps/HTMLViewer.git
git clone git: // android.git.kernel.org/platform/packages/apps/IM.git
git clone git: // android.git.kernel.org/platform/packages/apps/Launcher.git
git clone git: // android.git.kernel.org/platform/packages/apps/Launcher2.git
git clone git: // android.git.kernel.org/platform/packages/apps/Mms.git
git clone git: // android.git.kernel.org/platform/packages/apps/Music.git
git clone git: // android.git.kernel.org/platform/packages/apps/Nfc.git
git clone git: // android.git.kernel.org/platform/packages/apps/OTAProvisioningClient.git
git clone git: // android.git.kernel.org/platform/packages/apps/PackageInstaller.git
git clone git: // android.git.kernel.org/platform/packages/apps/Phone.git
git clone git: // android.git.kernel.org/platform/packages/apps/Protips.git
git clone git: // android.git.kernel.org/platform/packages/apps/Provision.git
git clone git: // android.git.kernel.org/platform/packages/apps/QuickSearchBox.git
git clone git: // android.git.kernel.org/platform/packages/apps/Settings.git
git clone git: // android.git.kernel.org/platform/packages/apps/SoundRecorder.git
git clone git: // android.git.kernel.org/platform/packages/apps/SpeechRecorder.git
git clone git: // android.git.kernel.org/platform/packages/apps/Stk.git
git clone git: // android.git.kernel.org/platform/packages/apps/Sync.git
git clone git: // android.git.kernel.org/platform/packages/apps/Tag.git
git clone git: // android.git.kernel.org/platform/packages/apps/Updater.git
git clone git: // android.git.kernel.org/platform/packages/apps/VoiceDialer.git
git clone git: // android.git.kernel.org/platform/packages/experimental.git
git clone git: // android.git.kernel.org/platform/packages/inputmethods/LatinIME.git
git clone git: // android.git.kernel.org/platform/packages/inputmethods/OpenWnn.git
git clone git: // android.git.kernel.org/platform/packages/inputmethods/PinyinIME.git
git clone git: // android.git.kernel.org/platform/packages/providers/ApplicationsProvider.git
git clone git: // android.git.kernel.org/platform/packages/providers/CalendarProvider.git
git clone git: // android.git.kernel.org/platform/packages/providers/ContactsProvider.git
git clone git: // android.git.kernel.org/platform/packages/providers/DownloadProvider.git
git clone git: // android.git.kernel.org/platform/packages/providers/DrmProvider.git
git clone git: // android.git.kernel.org/platform/packages/providers/GoogleContactsProvider.git
git clone git: // android.git.kernel.org/platform/packages/providers/GoogleSubscribedFeedsProvider.git
git clone git: // android.git.kernel.org/platform/packages/providers/ImProvider.git
git clone git: // android.git.kernel.org/platform/packages/providers/ManagementProvider.git
git clone git: // android.git.kernel.org/platform/packages/providers/MediaProvider.git
git clone git: // android.git.kernel.org/platform/packages/providers/TelephonyProvider.git
git clone git: // android.git.kernel.org/platform/packages/providers/UserDictionaryProvider.git
git clone git: // android.git.kernel.org/platform/packages/providers/WebSearchProvider.git
git clone git: // android.git.kernel.org/platform/packages/services/EasService.git
git clone git: // android.git.kernel.org/platform/packages/services/LockAndWipe.git
git clone git: // android.git.kernel.org/platform/packages/wallpapers/Basic.git
git clone git: // android.git.kernel.org/platform/packages/wallpapers/LivePicker.git
git clone git: // android.git.kernel.org/platform/packages/wallpapers/MagicSmoke.git
git clone git: // android.git.kernel.org/platform/packages/wallpapers/MusicVisualization.git
git clone git: // android.git.kernel.org/platform/prebuilt.git
git clone git: // android.git.kernel.org/platform/recovery.git
git clone git: // android.git.kernel.org/platform/sdk.git
git clone git: // android.git.kernel.org/platform/system/bluetooth.git
git clone git: // android.git.kernel.org/platform/system/core.git
git clone git: // android.git.kernel.org/platform/system/extras.git
git clone git: // android.git.kernel.org/platform/system/media.git
git clone git: // android.git.kernel.org/platform/system/netd.git
git clone git: // android.git.kernel.org/platform/system/vold.git
git clone git: // android.git.kernel.org/platform/system/wlan/broadcom.git
git clone git: // android.git.kernel.org/platform/system/wlan/ti.git
git clone git: // android.git.kernel.org/platform/tools/tradefederation.git
git clone git: // android.git.kernel.org/platform/vendor/aosp.git
git clone git: // android.git.kernel.org/platform/vendor/asus/eee_701.git
git clone git: // android.git.kernel.org/platform/vendor/csr/unifi-105x.git
git clone git: // android.git.kernel.org/platform/vendor/csr/unifi-60xx.git
git clone git: // android.git.kernel.org/platform/vendor/htc/common-open.git
git clone git: // android.git.kernel.org/platform/vendor/htc/dream-open.git
git clone git: // android.git.kernel.org/platform/vendor/htc/prebuilt-open.git
git clone git: // android.git.kernel.org/platform/vendor/htc/sapphire-open.git
git clone git: // android.git.kernel.org/platform/vendor/pv-open.git
git clone git: // android.git.kernel.org/platform/vendor/qcom/android-open.git
git clone git: // android.git.kernel.org/platform/vendor/qcom/proprietary-open.git
git clone git: // android.git.kernel.org/platform/vendor/qcom/surf.git
git clone git: // android.git.kernel.org/platform/vendor/renesas/ms7724.git
git clone git: // android.git.kernel.org/platform/vendor/sample.git
git clone git: // android.git.kernel.org/platform/vendor/st-ericsson/u300.git
git clone git: // android.git.kernel.org/toolchain/benchmark.git
git clone git: // android.git.kernel.org/toolchain/binutils.git
git clone git: // android.git.kernel.org/toolchain/build.git
git clone git: // android.git.kernel.org/toolchain/gcc.git
git clone git: // android.git.kernel.org/toolchain/gdb.git
git clone git: // android.git.kernel.org/toolchain/gmp.git
git clone git: // android.git.kernel.org/toolchain/gold.git
git clone git: // android.git.kernel.org/toolchain/manifest.git
git clone git: // android.git.kernel.org/toolchain/mpc.git
git clone git: // android.git.kernel.org/toolchain/mpfr.git
git clone git: // android.git.kernel.org/tools/android-issuetrackerredirect.git
git clone git: // android.git.kernel.org/tools/executablewar.git
git clone git: // android.git.kernel.org/tools/gerrit-contactstore.git
git clone git: // android.git.kernel.org/tools/gerrit-keyapplet.git
git clone git: // android.git.kernel.org/tools/gerrit.git
git clone git: // android.git.kernel.org/tools/gimd.git
git clone git: // android.git.kernel.org/tools/gwtexpui.git
git clone git: // android.git.kernel.org/tools/gwtjsonrpc.git
git clone git: // android.git.kernel.org/tools/gwtorm.git
git clone git: // android.git.kernel.org/tools/manifest.git
git clone git: // android.git.kernel.org/tools/protobuf.git
git clone git: // android.git.kernel.org/tools/repo.git
git clone git: // android.git.kernel.org/tools/test/manifest.git
git clone git: // android.git.kernel.org/tools/test/project0.git

我是将信息直接输出到控制台,这个是比较新的版本,如果再有更新可以用以上的方法更新下面的配置文件

在git的控制台上

img_b96f79164cc101993b27438ca5d49974.jpg

点击左上角点击编缉,粘贴

然后就是等待,等待...........

目录
相关文章
|
1月前
|
存储 缓存 Android开发
安卓Jetpack Compose+Kotlin, 使用ExoPlayer播放多个【远程url】音频,搭配Okhttp库进行下载和缓存,播放完随机播放下一首
这是一个Kotlin项目,使用Jetpack Compose和ExoPlayer框架开发Android应用,功能是播放远程URL音频列表。应用会检查本地缓存,如果文件存在且大小与远程文件一致则使用缓存,否则下载文件并播放。播放完成后或遇到异常,会随机播放下一首音频,并在播放前随机设置播放速度(0.9到1.2倍速)。代码包括ViewModel,负责音频管理和播放逻辑,以及UI层,包含播放和停止按钮。
140 0
|
18天前
|
存储 安全 Java
Android面试题之ArrayList源码详解
ArrayList是Java中基于数组实现的列表,提供O(1)的索引访问,但插入和删除操作平均时间复杂度为O(n)。默认容量为10,当需要时会通过System.arraycopy扩容。允许存储null,非线程安全。面试常问:List是接口,ArrayList是其实现之一,推荐使用List接口编程以实现更好的灵活性。更多详情见[ArrayList源码](http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8u40-b25/java/util/ArrayList.java#ArrayList.Node)。
14 2
|
24天前
|
Android开发 Windows
如何离线下载 Microsoft Corporation II Windows Subsystem for Android
如何离线下载 Microsoft Corporation II Windows Subsystem for Android
22 1
|
1月前
|
Windows
【Windows驱动开发】注册表的基本操作(创建、打开、修改、读取、枚举)(附源码)
【Windows驱动开发】注册表的基本操作(创建、打开、修改、读取、枚举)(附源码)
|
1月前
|
缓存 Android开发 Kotlin
【安卓app开发】kotlin Jetpack Compose框架 | 先用OKhttp下载远程音频文件再使用ExoPlayer播放
使用 Kotlin 的 Jetpack Compose 开发安卓应用时,可以结合 OkHttp 下载远程音频文件和 ExoPlayer 进行播放。在 `build.gradle` 添加相关依赖后,示例代码展示了如何下载音频并用 ExoPlayer 播放。代码包括添加依赖、下载文件、播放文件及简单的 Compose UI。注意,示例未包含完整错误处理和资源释放,实际应用需补充这些内容。
|
1月前
|
存储 Android开发 Kotlin
开发安卓app OKhttp下载后使用MediaPlayer播放
在Android Jetpack Compose应用程序中,要使用OkHttp下载远程音频文件并在本地播放,你需要完成以下几个步骤: 1. **添加依赖**:确保`build.gradle`文件包含OkHttp和Jetpack Compose的相关依赖。 2. **下载逻辑**:创建一个`suspend`函数,使用OkHttp发起网络请求下载音频文件到本地。 3. **播放逻辑**:利用`MediaPlayer`管理音频播放状态。 4. **Compose UI**:构建用户界面,包含下载和播放音频的按钮。
|
17天前
|
JavaScript Java 测试技术
基于springboot+vue.js+uniapp的高校后勤网上报修系统安卓app附带文章源码部署视频讲解等
基于springboot+vue.js+uniapp的高校后勤网上报修系统安卓app附带文章源码部署视频讲解等
15 0
|
20天前
|
Java Linux 开发工具
Windows环境下Android Studio v1.0安装教程
Windows环境下Android Studio v1.0安装教程
25 0
|
1月前
|
JSON 编解码 Apache
Android中使用HttpURLConnection实现GET POST JSON数据与下载图片
Android中使用HttpURLConnection实现GET POST JSON数据与下载图片
22 1
|
25天前
|
Java API Android开发
技术经验分享:Android源码笔记——Camera系统架构
技术经验分享:Android源码笔记——Camera系统架构
22 0

推荐镜像

更多