小编hey*_*you的帖子

Horizo​​ntall滚动在android工作室

我正在使用macbook pro 13"并在其上运行Windows 8.1(Bootcamp).我安装了android studio(用于开发Android应用程序的IDE).我想知道如何水平滚动(从触摸板或魔法从左到右或从右到左)鼠标)在IDE上 - 编辑器本身??就像在Visual Studio中一样,我可以使用我的两个手指从左向右滑动以从左到右滚动触摸板和魔术鼠标的编辑器.

屏幕截图通过触摸板或魔术鼠标水平滚动编辑器

ide android android-studio

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

即使App已关闭,也会收到Android推送通知

我尝试过使用Google GCM但是当应用关闭时(从任务管理器中滑动或清除),它不会收到任何推送通知.当我再次打开应用程序时,通知已经消失并丢失.

GCM正致力于: - 应用程序已打开 - 应用程序已最小化

不工作: - 应用程序已关闭(从任务管理器轻扫) - 通过清除任务管理器中所有打开的应用程序关闭应用程序

即使应用程序像Facebook或Instagram一样关闭,我也希望收到推送通知.我怎么能实现这个?这可能在GCM中有用吗?如果有,怎么样?如果没有,那么实现这个的另一种方法是什么?

这是我的代码:

AndroidManifest.xml中

<!-- [START gcm_receiver] -->
    <receiver
        android:name="com.google.android.gms.gcm.GcmReceiver"
        android:exported="true"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <category android:name="com.example.airwyntin.notificationtest" />
        </intent-filter>
    </receiver>
    <!-- [END gcm_receiver] -->

    <!-- [START gcm_listener] -->
    <service
        android:name=".MyGcmListenerService"
        android:exported="false" >
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
        </intent-filter>
    </service>
    <!-- [END gcm_listener] -->
    <!-- [START instanceId_listener] -->
    <service
        android:name=".MyInstanceIDListenerService"
        android:exported="false">
        <intent-filter>
            <action android:name="com.google.android.gms.iid.InstanceID"/>
        </intent-filter>
    </service>
    <!-- [END instanceId_listener] -->
    <service
        android:name=".RegistrationIntentService"
        android:exported="false">
    </service>
Run Code Online (Sandbox Code Playgroud)

MyGcmListenerService.java:

public class MyGcmListenerService extends …
Run Code Online (Sandbox Code Playgroud)

notifications android push google-cloud-messaging

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

在Azure中使用事件日志(在事件查看器中写入)

我的网站用ASP.NET编写,我使用EventLog将日志写入事件查看器.它已在生产中运行(操作系统:Windows Server 2012 R2),并且在记录某些错误时没有遇到任何问题.我现在计划将服务器迁移到Azure - App Services.我想知道我的代码在记录错误后是否仍然可以移动到Azure - App Services?如果是,那么我如何查看我的网站记录的错误?我无法在Azure - App Services中看到事件查看器.如果不是那么在记录错误时替换我的代码的最简单和最快的替代方法是什么?

这是我的代码:

public static void LogEventLog(string message, EventLogEntryType logType)
    {
        string source = AppConfig.ErrorEventViewerSource;

        // Since we can't prevent the app from terminating, log this to the event log. 
        CreateEventSource(source);

        // Create an EventLog instance and assign its source.
        EventLog myLog = new EventLog();
        myLog.Source = source;
        myLog.WriteEntry(message, logType);

    }



    public static void CreateEventSource(string source)
    {
        if (!EventLog.SourceExists(source))
        {
            EventLog.CreateEventSource(source, "Application");
        }
    }
Run Code Online (Sandbox Code Playgroud)

c# asp.net azure event-log event-viewer

5
推荐指数
1
解决办法
1530
查看次数