小编Man*_*epa的帖子

通过编程方式实现以太网连接(Android)(Root设备)

我有一个关于以太网的小问题.

我的三个问题是:

  1. 我们可以通过编程方式开启/关闭Ethernet吗?

  2. 我们可以编程启用/禁用Ethernet吗?

  3. 我们能以编程方式连接Ethernet吗?

上述问题是通过以下方式完成的Wifi.喜欢

  1. 我们可以通过编程方式开启/关闭Wifi.

  2. 我们可以通过编程方式启用/禁用Wifi.

  3. 我们可以通过编程连接Wifi使用WifiManager.

android是否提供任何EthernetManager类似WifiManager处理Ethernet

或者,如果这似乎不可行,那么我原来的要求是:

我要澄清的第一件事是"设备已经生根".

我可以操作设置(默认)吗?就像我不希望Settings.apk除了WIFI和之外的任何其他选项Ethernet.它应该只显示WifiEthernet.而已.我可以从"设置"中禁用所有选项,还是可以从"设置"中删除所有其他选项?

android ethernet android-networking

19
推荐指数
3
解决办法
2万
查看次数

如何更改标签栏控制器项目名称的字体大小?

我正在做一个基于tabbarController的应用程序.我有3个tabbar项目.

我的问题是:如何更改标签栏项目标题的字体样式?

iphone xcode objective-c

16
推荐指数
1
解决办法
1万
查看次数

以编程方式将服务器证书信息添加到Trust Manager Android

我是这个SSLX509CertificateConcept的新手.我需要的是,有没有办法从给定的证书信息中获取Url

例如:如果用户键入了https://www.google.com,那么我需要以编程方式获取证书信息.

编辑:

最后,我从服务器获得了证书信息.

现在,我的问题是:

1.如何检查证书是否可信?

2.如何将证书添加到信任管理器?

3.即使是不可信证书,如果用户想继续使用,那么我需要将证书添加到信任管理器.我怎样才能实现这一目标?

4.为了检查证书是否可信,我们真的需要另外一个证书进行比较吗?

我对这些非常陌生 X.509 Certificate.

任何帮助都会得到真正的赞赏.

编辑:

这就是我所尝试的.但是,他们都没有帮助我.我需要获得证书是否可信.

X509TrustManager trustManager = new X509TrustManager() {
                @Override
                public void checkClientTrusted(X509Certificate[] chain,
                        String authType) throws CertificateException {
                    for (TrustManager tm : managers) {
                        if (tm instanceof X509TrustManager) {
                            ((X509TrustManager) tm).checkClientTrusted(
                                    chain, authType);
                        }
                    }
                }

                @Override
                public void checkServerTrusted(X509Certificate[] chain,
                        String authType) {

                    for (X509Certificate cert : chain) {

                        final String …
Run Code Online (Sandbox Code Playgroud)

android x509certificate

16
推荐指数
1
解决办法
2674
查看次数

集成Air Watch Android Studio

我对AirWatch Concept非常陌生,但对AirWatch进行了彻底的了解.我已经通过以下链接,

http://developer.air-watch.com/android/application-configuration-with-the-android-sdk/

http://developer.air-watch.com/android/android-sdk-setup/

但是徒劳无功

关于Air Watch在Android中的集成,有谁可以帮助我?

我到目前为止所做的事情,

我在https://apidev.awmdm.com上创建了应用程序,并添加了assignemnts.这里的问题是,如何在我的Android应用程序中获取Air Watch Console中添加的分配详细信息.

非常感谢帮助.

更新:

我能够将应用程序从AIR WATCH CONSOLE创建并推送到我的设备.现在,我面临的问题是,如果我在AIR WATCH CONSOLE中添加一些应用程序配置,我无法在我的应用程序中获取这些详细信息.

我已经通过下面的Url了解上述情况,

https://appconfig.org/android/https://appconfig.org/ios/非常相似

我已经实现了上面提到的那些内容,但是我仍然无法获得这些细节.如果我在任何地方都错了,请告诉我.

我知道在Air手表控制台中传递的关键值对将成为com.apple.configuration.managediOS中的关键.有没有人知道这些关键价值对将如何产生.据我所知,他们将通过Restriction Manager.但不知道/线索如何在Android中处理.

更新:

xml/app_restrictions.xml:

<?xml version="1.0" encoding="utf-8"?>
<restrictions xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <restriction
        android:key="ManagedServer"
        android:restrictionType="string"
        android:title="Managed Server"
        tools:ignore="ValidRestrictions" />

    <restriction
        android:key="@string/mdm_key_managed_server_name"
        android:restrictionType="string"
        android:title="@string/mdm_key_managed_server_url"
        tools:ignore="ValidRestrictions" />
    <restriction
        android:key="@string/mdm_key_managed_server_url"
        android:restrictionType="string"
        android:title="@string/mdm_key_managed_server_url"
        tools:ignore="ValidRestrictions" />

</restrictions>
Run Code Online (Sandbox Code Playgroud)

oncreate 方法 :

IntentFilter restrictionsFilter =
                new IntentFilter(Intent.ACTION_APPLICATION_RESTRICTIONS_CHANGED);

    BroadcastReceiver restrictionsReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context …
Run Code Online (Sandbox Code Playgroud)

android android-studio airwatch

10
推荐指数
1
解决办法
1223
查看次数

由于不建议使用Places Picker,因此实现了与WhatsApp相同的共享位置Places Picker

我们有一个共享位置的要求,这是与用户界面和功能类似的类似WhatsApp的位置。

我发现Google Place Picker已过时,并且已迁移到Places Clients。

像这样说

当他们试图搜索时

可能是,我不擅长解释我的想法,但总的来说,我正在寻求上述实现。

而且我还从下面的网址中得知Google会对搜索或地点收费,

https://github.com/rtchagas/pingplacepicker

我所累的是

编码部分:

Places.initialize(applicationContext, "Google API Key")
placesClient = Places.createClient(this)



val autocompleteFragment =
          getSupportFragmentManager().findFragmentById(R.id.autocomplete_fragment) as AutocompleteSupportFragment

autocompleteFragment.setPlaceFields(Arrays.asList(Place.Field.ID, Place.Field.NAME));

autocompleteFragment.setOnPlaceSelectedListener(object : PlaceSelectionListener {
            override fun onPlaceSelected(p0: Place) {
                TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
            }

            override fun onError(p0: Status) {
                TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
            }
        });

 val intent = Autocomplete.IntentBuilder(
            AutocompleteActivityMode.FULLSCREEN, fields …
Run Code Online (Sandbox Code Playgroud)

android google-places-api google-places kotlin google-places-autocomplete

9
推荐指数
1
解决办法
330
查看次数

加载Adobe Illustrator(.ai)文件

是否可以加载.ai文件并以编程方式打开它们?

这是我尝试过的:

- (IBAction)openDocument:(id)sender
{
    QLPreviewController *previewController = [[QLPreviewController alloc] init];
    [previewController setDataSource:self];
    [previewController setDelegate:self];
    [self presentModalViewController:previewController animated:YES];
}

- (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller
{
    return 1;
}

- (id <QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index
{
    return [[NSBundle mainBundle] URLForResource:@"CNW EXPLODED1" withExtension:@"ai"];
}
Run Code Online (Sandbox Code Playgroud)

但输出是这样的:

在此输入图像描述

cocoa-touch objective-c adobe-illustrator ios

8
推荐指数
1
解决办法
1119
查看次数

在Android中检查图像半加载或不加载

我从API获取Image作为BLOB类型.而且,我保存如下,

public static void setOptimalImage(Context ctx, File file, ImageView iv,
            Point size) {
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        BitmapFactory.decodeFile(file.getPath(), options);
        if (options.outHeight > 0 && options.outWidth > 0) {
            if (size == null) {
                size = new Point();
                WindowManager wm = (WindowManager) ctx
                        .getSystemService(Context.WINDOW_SERVICE);
                wm.getDefaultDisplay().getSize(size);
            }
            options.inSampleSize = Utils.calculateInSampleSize(options, size.x,
                    size.y);
            options.inJustDecodeBounds = false;
            try {
                iv.setImageBitmap(BitmapFactory.decodeFile(file.getPath(),
                        options));
            } catch (OutOfMemoryError oome) {
                Log.e(Utils.class.getName(),
                        oome.getMessage() == null ? "OutOfMemory error: "
                                + file.getName() : oome.getMessage());
            }
        } …
Run Code Online (Sandbox Code Playgroud)

android image

8
推荐指数
1
解决办法
526
查看次数

如何从文档文件夹中的文件中获取数据

我是xcode和Objective c的新手.

首先,我在文档目录中创建了一个文件并创建了它,现在我需要的是如何从该文件中读取数据,例如文件是否包含特定字符串

我怎么能得到它

iphone

7
推荐指数
1
解决办法
1874
查看次数

UIPasteBoard不粘贴音频文件?

我正在开发一个应用程序,其中一个模块是,一个简单的列表TableView,显示音频文件列表.当用户选择任何音频文件时,操作表附带一个选项SMS.我需要通过短信发送特定的音频文件.请让我知道如何使用它.

如果这是不可能的,请提供苹果文档,以便它作为我展示的证据.

这是我试图粘贴音频文件...

第一种方式:

UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
NSString *path = [[NSBundle mainBundle] pathForResource:@"audiofilename" ofType:@"caf"];
NSData *myData = [NSData dataWithContentsOfFile:path];
[pasteboard setData:myData forPasteboardType:@"audiofile"];
NSString  *copyPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/audiofile.caf"];
NSURL *sndURL = [NSURL fileURLWithPath:copyPath];
[pasteboard setString:[NSString stringWithFormat:@"%@",sndURL]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"sms:12345678"]]];
Run Code Online (Sandbox Code Playgroud)

第二种方式:

Class messageClass = (NSClassFromString(@"MFMessageComposeViewController"));

if([messageClass canSendText])
{
    messagepicker = [[MFMessageComposeViewController alloc] init];
    messagepicker.messageComposeDelegate = self;
    UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
    NSString *path = [[NSBundle mainBundle] pathForResource:@"290912044119" ofType:@"caf"];
    NSData *myData = [NSData dataWithContentsOfFile:path];
    [pasteboard setData:myData forPasteboardType:@"audiofile"];
    NSString  *copyPath …
Run Code Online (Sandbox Code Playgroud)

iphone sms uipasteboard

6
推荐指数
1
解决办法
843
查看次数

UISearchBar与iMac Finder搜索功能相同

我遇到了一个要求,其中我有UISearchBar,如下所示.

步骤:1(SearchBar的初始外观)

在此输入图像描述

步骤:2(用户输入字符串和即时搜索)

在此输入图像描述

步骤:3(在搜索列表中选择任何一个)

在此输入图像描述

步骤:4(添加SearchBar上的按钮)

在此输入图像描述

步骤:5(最后按钮上的操作)

在此输入图像描述

这可能会继续.我的意思是说他可以进一步输入文本,但功能应该是相同的.

有人可以帮帮我吗?拜托,我有需要.

UPDATE

您可以在iMac Finder Search上观看相同的功能

这就是我尝试过的.

#import "ViewController.h"
#import "customPopOverController.h"
#import <QuartzCore/QuartzCore.h>
@interface ViewController ()
@property (strong, nonatomic) UIView *searchView;
@property (strong, nonatomic) UITableView *sampleView;
@property (strong, nonatomic) NSMutableArray *arrayForListing;
@property (strong, nonatomic) UITextField *txtFieldSearch;
@end

@implementation ViewController
@synthesize searchView = _searchView;
@synthesize customPopOverController = _customPopOverController;
@synthesize txtFieldSearch = _txtFieldSearch;
@synthesize sampleView = _sampleView;
@synthesize arrayForListing = _arrayForListing;
@synthesize btnforExtra = _btnforExtra;
- (void)viewDidLoad
{
    [super viewDidLoad];
    self.arrayForListing = [[NSMutableArray alloc]init];
    [self loadTheSearchView]; …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c uisearchbar ios

6
推荐指数
1
解决办法
339
查看次数