小编Qua*_*Ali的帖子

"创建项目"菜单中的API集成的Eclipse插件和ADT修改

我计划创建一个与Android项目的API集成相关的插件.我可以检查/标记我要添加的API,它应该添加所有相关文件,并将示例集成在Main_Activity /或用户创建的默认活动中.

作为首发,我需要知道:

1)我是否只需要开始研究eclipse代码或ADT插件?

2)是否有任何此类插件可用?

3)我需要开始学习ADT的哪个类别,以便我可以在Create android project菜单中开始学习它?

到目前为止,我已经开始检查ADT代码了.网上什么都没有,所以我不能告诉你我做了什么.

eclipse api android eclipse-plugin eclipse-adt

21
推荐指数
1
解决办法
185
查看次数

iOS - 视频不能仅在iOS7上通过iPhone旋转?

我做了什么?

我正在MPMoviePlayerViewController的扩展类中播放视频,并实现了如下的方向功能

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {

    if (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown){
        return FALSE;
    }
    else{
        return TRUE;
    }
}

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
    [self setControlsPositions:toInterfaceOrientation];
}
-(BOOL)shouldAutorotate
{
    return YES;
}
Run Code Online (Sandbox Code Playgroud)

我面临的问题是什么?

该应用程序可以在iPhone和iPad上使用iPad(iOS7)上的iOS6上运行良好,但视频不会在安装了iOS7的iPhone上旋转.

这个问题的原因是什么以及如何解决?

更新

我发现,在影片结束的旋转,如果setMovieSourceType设置为MPMovieSourceTypeUnknown,但是当设置为'MPMovieSourceTypeStreaming不旋转

mpmovieplayercontroller media-player mpmovieplayer ios ios7

15
推荐指数
1
解决办法
4083
查看次数

无法通过终端运行应用程序,但应用程序在XCode中正常运行

我正在研究lilgp,它是基于交流语言的遗传编程工具.我面临的问题是我正在使用XCode进行项目,它工作正常并通过终端显示正确的输出.但是当我尝试在DerivedData我的XCode项目中运行相同的应用程序时,我得到了分段错误(11)

然后我检查了Utilities中的控制台是否有错误,显示错误

    Process:               Theisis [9325]
Path:                  /Users/USER/Library/Developer/Xcode/DerivedData/Theisis-gszeehddtmnlkqdbicpeffygvkcw/Build/Products/Release/Theisis
Identifier:            Theisis
Version:               0
Code Type:             X86-64 (Native)
Parent Process:        bash [8987]
Responsible:           Terminal [299]
User ID:               501

Date/Time:             2016-09-11 01:05:25.158 +0500
OS Version:            Mac OS X 10.11.6 (15G31)
Report Version:        11
Anonymous UUID:        4063B9C3-F525-D9BD-EF5E-358810571673

Sleep/Wake UUID:       CA5341A7-C252-4C76-B694-7F2DAE196F79

Time Awake Since Boot: 57000 seconds
Time Since Wake:       1600 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000068

VM …
Run Code Online (Sandbox Code Playgroud)

c c++ xcode c++11

14
推荐指数
1
解决办法
564
查看次数

以编程方式添加Word for Word预测

我正在使用UserDictionary.Words类的addWord函数将Words添加到Dictionary中,以便它们可以显示在Text预测中.单词确实存在于字典中APP_ID=0,可用于默认的android键盘.但是我使用的是Swift键盘,并没有将这些词用于预测.

我正在使用这个教程

 UserDictionary.Words.addWord(this, "ThisIsSomeWordIwantForPrediction", 250, null, Locale.getDefault());
Run Code Online (Sandbox Code Playgroud)

我的问题是我如何添加单词,以便它们可用于所有键盘的预测

android cpu-word keyword android-userdictionary

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

无法从Objective C中的Block Code更新UIView

我正在尝试更新标签,以显示要使用AFNetworking Framework 下载的文件的进度.问题是,当我设置的百分比的标签在setProgressiveDownloadProgressBlock 下载完成后的标签,只有当下载开始和更新.

 __weak MTCViewController *weakSelf= self; 
[_operation setProgressiveDownloadProgressBlock:^(AFDownloadRequestOperation *operation, NSInteger bytesRead, long long totalBytesRead, long long totalBytesExpected, long long totalBytesReadForFile, long long totalBytesExpectedToReadForFile) {
        float percent = (float)(totalBytesRead / totalBytesExpectedToReadForFile)*100;;
       // [weakSelf updateProgress:percent];
        [weakSelf updateText:[NSString stringWithFormat:@"Progress = %f",percent]];
    }];
    [_operation start];
Run Code Online (Sandbox Code Playgroud)

另外,当我删除标签更新代码时,该块似乎正在正确更新

iphone objective-c ios afnetworking

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

目标C - 使用AFNetworking下载文件时网络连接丢失"错误

我正在使用Tony Million的可达性代码, 并且在无法访问的块中我试图暂停下载但是每次互联网断开连接之前下载暂停AFNetworking返回失败并显示错误消息"网络连接丢失"因此无法恢复下载那么应该做什么?

这就是我在Application Delegate中所做的

__weak MTCAppDelegate *weakself = self;
Reachability * reach = [Reachability reachabilityWithHostname:@"www.google.com"];


reach.reachableBlock = ^(Reachability * reachability)
{
    dispatch_async(dispatch_get_main_queue(), ^{
        [[AFDROSingleton sharedInstance] resume];
        for (UIView *subview in [weakself.window subviews]) {
            if (subview.tag == 20) {
                [subview removeFromSuperview];
            }
        }
    });
};

reach.unreachableBlock = ^(Reachability * reachability)
{
    dispatch_async(dispatch_get_main_queue(), ^{
        MTCReachability *reach = [[MTCReachability alloc] initWithFrame:weakself.window.frame];
        [reach setTag:20];
        [weakself.window addSubview:reach];
        [weakself.window bringSubviewToFront:reach];
       [[AFDROSingleton sharedInstance] pause];
    });
};

[reach startNotifier];
Run Code Online (Sandbox Code Playgroud)

uikit ios afnetworking

7
推荐指数
0
解决办法
2106
查看次数

Android - MediaPlayer即使在Android 4.0+上准备流之前就准备好了

我面临的问题是,每当我的应用程序在Android 4.0 +上播放流时,即使在加载流之前也会调用OnPrepare方法MediaPlayer.OnPreparedListener,因此我无法向用户表明流下载/缓冲正在进行中.我已经找到了同样的问题,但没有回答 这是我正在做的事情.

   @Override
    public void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);  
        playVideo(someRtspUrl);
    }
    private void playVideo(String url) {
        // if app is running on Google TV then change RTSP link to HLS
        if (url.contains("rtsp")) {

            // split the RTSP URL and make it as HLS
            String videoUrlParts[] = url.split("\\?");
            url = videoUrlParts[0].replace("rtsp", "http") + "/playlist.m3u8";

            if (videoUrlParts.length > 1)
                url += "?" + videoUrlParts[1];
        }   mVideoView.setVideoURI(Uri.parse(url));
        mVideoView.requestFocus();
        mVideoView.setOnCompletionListener(this);
        mVideoView.setOnPreparedListener(this); 

    }



    @Override
        public void onPrepared(MediaPlayer …
Run Code Online (Sandbox Code Playgroud)

java android video-streaming media-player android-4.2-jelly-bean

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

垃圾收集器是否会删除静态最终对象?

我以前在Java服务中使用了自定义对象,它始终在后端运行,我有时会收到Bug报告,其中的跟踪显示NULL_POINTER_EXCEPTION垃圾收集器已经破坏了对象.由于我拥有所有高端设备,我无法测试这是否会导致静态最终对象被垃圾收集器破坏?

java garbage-collection

7
推荐指数
2
解决办法
1687
查看次数