[안드로이드 예제] GCM으로 푸시주는 어플(어플리케이션;앱) (안드로이드) DEVICE_TO_DEVICE_GCM
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
해당 자료는 10페이지 까지만 미리보기를 제공합니다.
10페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

[안드로이드 예제] GCM으로 푸시주는 어플(어플리케이션;앱) (안드로이드) DEVICE_TO_DEVICE_GCM에 대한 보고서 자료입니다.

목차

[android_files]
  [MobileToMobileGCM]
    [assets]
    [bin]
    [gen]
    [libs]
    [res]
    [src]
    .classpath
    .project
    AndroidManifest.xml
    ic_launcher-web.png
    lint.xml
    proguard-project.txt
    project.properties

[gcm_server_files]
  config.php
  function.php
  loader.php
  register.php
  send_push_notification_message.php
  sendpush.php
  unregister.php
  userdata.php
  validate_device.php



파일 52, 폴더 25
614KB

본문내용

SendPushNotification.java



package com.androidexample.mobilegcm;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import com.androidexample.mobilegcm.R;
import com.androidexample.mobilegcm.DBAdapter;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class SendPushNotification extends Activity {
    
    // UI elements
    EditText txtMessage;
    TextView sendTo;
    
    // Register button
    Button btnSend;

    Controller aController = null;
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        /******************* Intialize Database *************/
        DBAdapter.init(this);
        
        setContentView(R.layout.send_push_notification);
        
        //Get Global Controller Class object (see application tag in AndroidManifest.xml)
        aController = (Controller) getApplicationContext();
        
        // Check if Internet Connection present
        if (!aController.isConnectingToInternet()) {
            
            // Internet Connection is not present
            aController.showAlertDialog(SendPushNotification.this,
                    \"Internet Connection Error\",
                    \"Please connect to working Internet connection\", false);
            
            // stop executing code by return
            return;
        }

        // Getting name, email from intent
        Intent i = getIntent();
        
        final String name = i.getStringExtra(\"name\");
        final String imei = i.getStringExtra(\"imei\");
        final String sendfrom = i.getStringExtra(\"sendfrom\");
        
        
        txtMessage = (EditText) findViewById(R.id.txtMessage);
        sendTo = (TextView) findViewById(R.id.sendTo);
        btnSend = (Button) findViewById(R.id.btnSend);
        
        sendTo.setText(\"Send To : \"+name);
        
        // Click event on Register button
        btnSend.setOnClickListener(new View.OnClickListener() {
            
            @Override
            public void onClick(View arg0) {
                // Get data from EditText
                String message = txtMessage.getText().toString();
                
                // WebServer Request URL
         String serverURL = Config.YOUR_SERVER_URL+\"sendpush.php\";
        
         // Use AsyncTask execute Method To Prevent ANR Problem
         new LongOperation().execute(serverURL,imei,message,sendfrom);
        
         txtMessage.setText(\"\");
            }
        });
    }
  • 가격5,000
  • 페이지수52페이지
  • 등록일2014.06.07
  • 저작시기2014.1
  • 파일형식압축파일(zip)
  • 자료번호#922293
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니