GVKun编程网logo

如何将“流星运行android-device”发送到流星服务器?(流星手机端)

13

对于如何将“流星运行android-device”发送到流星服务器?感兴趣的读者,本文将会是一篇不错的选择,我们将详细介绍流星手机端,并为您提供关于AndroidStudio3.0找不到Android

对于如何将“流星运行android-device”发送到流星服务器?感兴趣的读者,本文将会是一篇不错的选择,我们将详细介绍流星手机端,并为您提供关于Android Studio 3.0 找不到 Android Device Monitor、Android Studio 打开 Android Device Monitor、Android Studio-如何将数据从MainActivity.xml发送到Service?、Android unique_id for android device的有用信息。

本文目录一览:

如何将“流星运行android-device”发送到流星服务器?(流星手机端)

如何将“流星运行android-device”发送到流星服务器?(流星手机端)

如果我使用命令:

meteor run android-device -p 192.168.232.142:3000

我有以下错误:

Can't listen on host 192.168.232.142 (EADDRNOTAVAIL from listen).

这样做很合理,因为192.168.232.142不是我的本地IP地址,而是我的远程Meteor开发服务器的IP地址.
另一方面,远程Meteor开发服务器上的相同命令将无济于事,因为我无法将Android设备连接到该设备. (通过USB adb).

因此,如何在指向远程Meteor服务器的本地连接的Android设备上安装android网络应用程序?

谢谢,

解决方法:

这个命令可以正常工作:

meteor run android-device --mobile-server http://remote_server.meteor.com

Android Studio 3.0 找不到 Android Device Monitor

Android Studio 3.0 找不到 Android Device Monitor

因为自 Android Studio 3.0 开始弃用 Android Device Monitor,Android Developers 官网上的原话是:

Android Device Monitor is a standalone tool that provides a UI for several Android app debugging and analysis tools.
However, most components of the Android Device Monitor are deprecated in favor of updated tools available in Android Studio 3.0 and higher. The table below helps you decide which developer tools you should use.

译文:

Android 设备监视器是一个独立的工具,为几个 Android 应用调试和分析工具提供了一个 UI。
但是,大多数 Android 设备监视器组件已弃用,以支持 Android Studio 3.0 和更高版本中提供的更新工具。下表帮助您决定应该使用哪些开发人员工具。

 

这里写图片描述
图 1.Android Developers 关于 Android Device Monitor 的说明页

 

虽然说被 “弃用”,但是不代表不支持,我们还是可以通过其他方式来使用 Android Device Monitor,具体使用方式如下:

android-sdk/tools/ 目录的命令行中输入以下内容:

如果你不知道你的 Android SDK 安装在哪个目录,预科可以在 Android Studio 的设置 1 中查看:

 

这里写图片描述
图 2.Android Studio 设置界面
进入 CMD 窗口 2,cd 到目标文件夹 tools 下,然后输入命令 montior
这里写图片描述
图 3.cmd 界面
接下来,我们就可以看到期待已久的 Android Device Monitor 界面了 3:
这里写图片描述
图 4.Android Device Monitor 界面

Android Studio 打开 Android Device Monitor

Android Studio 打开 Android Device Monitor

环境

Android Studio 4.1 for Windows

打开方法

想查看虚拟机中应用生成的文件在之前的Android Studio本版有个工具Android Device Monitor,在网上查看发现已经被弃用了。

打开方法可以参照CSDN Android Studio的Android Device Monitor在哪儿?,
如果单纯是查看文件可以可以使用替代方法

  1. 打开并运行Android虚拟机;

  2. 在Android Studio的顶部栏,View >> Tool Windows >> Device File Explorer;

  3. 在显示出来窗口data/data/目录下找就可以了。

介绍

Android Device Monitor:一个在Android程序开发调试时用到的一个工具,可以用于查看虚拟机中运行程序所在目录的文件管理器。

参考资料

  1. CSDN Android Studio的Android Device Monitor在哪儿?

Android Studio-如何将数据从MainActivity.xml发送到Service?

Android Studio-如何将数据从MainActivity.xml发送到Service?

添加有关意图的数据,

intent.putExtra("key","value");
,

由于您希望从Activity到Service进行通信(可能还有其他方式),因此需要使用BoundService。这将使您在Activity中获得服务绑定程序,然后调用服务方法...这是一个很大的简化,但是我认为深入研究将解决您的问题。

,

您必须首先将此行激活

startService(new Intent(activity,SampleService.class).putExtra("key","value"))

并将此行添加到服务中以通过onCreate或onStartCommand方法获取数据

intent.getStringExtra("key")

Android unique_id for android device

Android unique_id for android device

Objective:

I am looking for a way to find out a unique_id for android device.

Background:

I will use the Id in login request payload and as my app is license based service app the Id should not change under normal circumstances.

Existing Approaches:

In iOS there are some unique id solutions for iOS such as CFUUID or identifierForVendor coupled with Keychain,Advertising Identifier etc.. that can do this job upto the expectation.

But in Android all the options that I know seems to have hole in it.

IMEI:

TelephonyManager TelephonyMgr = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); 
String m_deviceId = TelephonyMgr.getDeviceId();

Drawbacks

It is sim card dependent so

  • If there is no sim card then we''re doomed

  • If there is dual sim then we''re dommed

Android_ID:

  String m_androidId = Secure.getString(getContentResolver(), Secure.ANDROID_ID);

Drawbacks

  • If OS version is upgraded then it may change
  • If device is rooted it gets changed
  • No guarantee that the device_id is unique there are some reports some manufacturers are having duplicate device_id

The WLAN MAC Address

WifiManager m_wm = (WifiManager)getSystemService(Context.WIFI_SERVICE); 
String m_wlanMacAdd = m_wm.getConnectionInfo().getMacAddress();

Drawbacks

  • If there is no wifi hardware then we''re doomed
  • In some new devices If wifi is off then we''re doomed.

Bluetooth Address:

   BluetoothAdapter m_BluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); 
   String m_bluetoothAdd = m_BluetoothAdapter.getAddress();

Drawbacks:

  • if there is no bluetooth hardware we''re doomed.
  • In future in some new devices we mightn''t able to read it if its off.

Possible solutions:

There are two approaches that I think to solve this problem

  • We generate a random id by hashing timestamp with unique ids that I have mentioned and store it so next time during login we’ll check if the the stored value of key is null if its so then we’ll generate and store it else we’ll use the value of the key.

    If there is something equivalent to keychain of iOS then we’re good with this approach.

  • Find a global identifier something like advertisingIdentifier of iOS which is same for all the apps in the device.

Any help is appreciated !

 

原文地址:https://stackoverflow.com/questions/27233518/perfect-unique-id-for-device-except-imei-android-id-wlan-mac-and-bluetooth-addre

今天的关于如何将“流星运行android-device”发送到流星服务器?流星手机端的分享已经结束,谢谢您的关注,如果想了解更多关于Android Studio 3.0 找不到 Android Device Monitor、Android Studio 打开 Android Device Monitor、Android Studio-如何将数据从MainActivity.xml发送到Service?、Android unique_id for android device的相关知识,请在本站进行查询。

本文标签: