Java 如何在我的gmail中接收Android应用程序中输入的详细信息(联系方式)?

Java 如何在我的gmail中接收Android应用程序中输入的详细信息(联系方式)?,java,android,xml,forms,Java,Android,Xml,Forms,我正在做一个android应用程序。我希望在我的个人邮件帐户中接收联系人表单中的输入。我试过其他几种代码。但问题是当我点击提交按钮时,邮件界面会弹出。我不要这个。我想知道我们在网站上的具体情况,在那里我们在联系表格中填写所有细节,这些细节必须在个人邮件或公司邮件中收到。请帮忙。代码如下 package com.ons.relihealth; 导入java.util.ArrayList; 导入java.util.List; 导入android.app.Activity; 导入android

我正在做一个android应用程序。我希望在我的个人邮件帐户中接收联系人表单中的输入。我试过其他几种代码。但问题是当我点击提交按钮时,邮件界面会弹出。我不要这个。我想知道我们在网站上的具体情况,在那里我们在联系表格中填写所有细节,这些细节必须在个人邮件或公司邮件中收到。请帮忙。代码如下


package com.ons.relihealth;
导入java.util.ArrayList;
导入java.util.List;
导入android.app.Activity;
导入android.os.Bundle;
导入android.view.view;
导入android.view.view.OnClickListener;
导入android.widget.AdapterView;
导入android.widget.AdapterView.OnItemClickListener;
导入android.widget.AdapterView.OnItemSelectedListener;
导入android.widget.ArrayAdapter;
导入android.widget.Button;
导入android.widget.EditText;
导入android.widget.Spinner;
导入android.widget.Toast;
公共类contactus扩展活动实现OnItemSelectedListener{
编辑文本编辑姓名,编辑电话,编辑电子邮件,信息;
按钮提交;
纺纱机;
名单;
字符串项;
@凌驾
创建时受保护的void(Bundle savedInstanceState){
//TODO自动生成的方法存根
super.onCreate(savedInstanceState);
setContentView(R.layout.contactus);
edit_name=(EditText)findViewById(R.id.edit_name);
edit_phone=(EditText)findViewById(R.id.edit_phone);
edit_email=(EditText)findViewById(R.id.edit_email);
message=(EditText)findViewById(R.id.message);
提交=(按钮)findViewById(R.id.submit);
微调器微调器=(微调器)findViewById(R.id.Spinner);
Spinner.setOnItemSelectedListener(此);
//微调器下拉元素
列表类别=新建ArrayList();
类别。添加(“个人健康计划”);
类别。添加(“家庭健康计划”);
类别。添加(“老年人计划”);
类别。添加(“补充计划”);
类别。添加(“旅行保险”);
类别。添加(“生育保险”);
类别。添加(“人身事故”);
类别。添加(“重大疾病保险”);
ArrayAdapter dataAdapter=新的ArrayAdapter(这是android.R.layout.simple\u微调器\u项,类别);
//下拉式布局样式-带单选按钮的列表视图
dataAdapter.setDropDownViewResource(android.R.layout.simple\u微调器\u下拉项);
//将数据适配器连接到微调器
Spinner.setAdapter(dataAdapter);
submit.setOnClickListener(新视图.OnClickListener(){
@凌驾
公共void onClick(视图v){
//TODO自动生成的方法存根
Toast.makeText(getApplicationContext(),“Item:”+Item+“edit_name:”+edit_name.getText().toString()+“edit_phone”+edit_phone.getText().toString()+“edit_email”+edit_email.getText().toString()+“message”,Toast.LENGTH_LONG.show();
}
});
}
@凌驾
已选择公共视图(AdapterView父视图、视图视图、整型位置、长id){
//TODO自动生成的方法存根
//关于选择微调器项
item=parent.getItemAtPosition(position.toString();
//显示所选微调器项
Toast.makeText(parent.getContext(),“Selected:Item”+Item+”,Toast.LENGTH\u LONG.show();
}
@凌驾
未选择公共无效(AdapterView父级){
//TODO自动生成的方法存根
}
}

当您调用Intent时,您可以将其视为等同于使用mailto锚定

通常,在没有用户干预的情况下,您如何将联系人表单中的详细信息发送到您的邮件id

有一个服务器端脚本来处理post请求,包括消息标题、正文、收件人等所有细节,对吗

在这种情况下,您也应该使用相同的方法

从EditText中提取值并向远程服务器发出post请求(如果您已经有了,则需要设置一个),然后在服务器端触发邮件。(这在任何服务器端语言中都非常简单)

注:
因为一切都是你自己处理的。确保您始终处理网络不可用、参数无效或内部服务器错误等错误情况,并显示“已发送消息”或“重试”

您检查过了吗?我该怎么做?例如:以一个有联系方式的网站为例,当我们点击提交按钮时,我应该在我的公司电子邮件或个人邮件中收到它?无论你想在哪里得到它。在这里阅读一些基础知识,我不想通过intent发送电子邮件。。。我的应用程序中有一个输入表单,客户可以在其中发送查询。单击“提交”,我将收到电子邮件中的详细信息。没有打开任何默认的电子邮件客户端。我的应用程序中的所有内容都很好。我得到了它。我可以用短信做同样的事情吗。比如,如果我点击提交按钮,我可以在短信中获得所有细节吗?Sry我对android是新手。我可能会问一些奇怪的问题。请帮助。我猜这是最简单的方法??所以这取决于你的要求,你介意用户为此短信收费吗?通常从Android应用程序发送短信的方式是什么。1.如果您同意应用程序用户使用sms,则可以使用SmsManager的sendTextMessage。。谷歌拥有大量的资源。2.如果您不想让用户付费,那么您应该再次将这些详细信息发布到您的服务器,您需要集成sms网关并发送此消息它是否回答了您的问题?最好在线程上有一个闭包。
<TextView
    android:id="@+id/contacttext"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="10dp"
    android:layout_marginTop="8dp"
    android:textSize="20sp"
    android:textStyle="bold"
    android:gravity="center_horizontal"
    android:text="@string/contacttext" />

<EditText
    android:id="@+id/edit_name"
    android:layout_width="290dp"
    android:layout_height="40dp"
    android:layout_below="@id/contacttext"
    android:layout_marginLeft="18dp"
    android:layout_marginTop="10dp"
    android:layout_gravity="center_horizontal"
    android:background="@drawable/shape"
    android:hint="@string/namehint" />

<EditText
    android:id="@+id/edit_phone"
    android:layout_width="290dp"
    android:layout_height="40dp"
    android:layout_below="@id/edit_name"
    android:layout_marginLeft="18dp"
    android:layout_marginTop="12dp"
    android:background="@drawable/shape"
    android:hint="@string/phone"
    android:inputType="phone" />

<EditText
    android:id="@+id/edit_email"
    android:layout_width="290dp"
    android:layout_height="40dp"
    android:layout_below="@id/edit_phone"
    android:layout_marginLeft="18dp"
    android:layout_marginTop="12dp"
    android:background="@drawable/shape"
    android:hint="@string/email"
    android:inputType="textEmailAddress" />

<Spinner
    android:id="@+id/Spinner"
    android:layout_width="290dp"
    android:layout_height="40dp"
    android:layout_below="@id/edit_email"
    android:layout_marginLeft="18dp"
    android:layout_marginTop="12dp"
    android:background="@drawable/shape" >
</Spinner>

<EditText
    android:id="@+id/message"
    android:layout_width="290dp"
    android:layout_height="100dp"
    android:layout_below="@id/Spinner"
    android:layout_marginLeft="18dp"
    android:layout_marginTop="12dp"
    android:background="@drawable/shape"
    android:inputType="text" />

<Button
    android:id="@+id/submit"
    android:layout_width="90dp"
    android:layout_height="wrap_content"
    android:layout_below="@id/message"
    android:layout_marginLeft="105dp"
    android:layout_marginTop="12dp"
    android:background="@drawable/newshape"
    android:text="@string/submit"
    android:textSize="18sp"
    android:textStyle="normal" />
package com.ons.relihealth;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;

public class contactus extends Activity implements OnItemSelectedListener  {

    EditText edit_name, edit_phone, edit_email, message;
    Button submit;
    Spinner spinner;
    List<String> list;
    String item;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.contactus);

        edit_name= (EditText)findViewById(R.id.edit_name);
        edit_phone= (EditText)findViewById(R.id.edit_phone);
        edit_email= (EditText)findViewById(R.id.edit_email);
        message= (EditText)findViewById(R.id.message);
        submit= (Button)findViewById(R.id.submit);


        Spinner Spinner = (Spinner) findViewById(R.id.Spinner);
        Spinner.setOnItemSelectedListener(this);

        // Spinner Drop down elements
        List<String> categories = new ArrayList<String>();
        categories.add("Individual Health Plan");
        categories.add("Family Health Plan");
        categories.add("Senior Citizen Plan");
        categories.add("Top Up Plan");
        categories.add("Travel Insurance");
        categories.add("Maternity insurance");
        categories.add("Personal Accident");
        categories.add("Critical Illness Insurance");


    ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, categories);

       // Drop down layout style - list view with radio button
    dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

          // attaching data adapter to spinner
    Spinner.setAdapter(dataAdapter);


    submit.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub          

            Toast.makeText(getApplicationContext(), "Item : "+item +"  edit_name : " +edit_name.getText().toString() + " edit_phone  " +edit_phone.getText().toString() + "  edit_email  "+edit_email.getText().toString()+ "  message", Toast.LENGTH_LONG).show();

        }
    });

    }
    @Override
    public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
        // TODO Auto-generated method stub

           // On selecting a spinner item
          item = parent.getItemAtPosition(position).toString();
       // Showing selected spinner item
          Toast.makeText(parent.getContext(), "Selected: Item " + item + "", Toast.LENGTH_LONG).show();
    }

    @Override
    public void onNothingSelected(AdapterView<?> parent) {
        // TODO Auto-generated method stub
    }
}