Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/187.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从浏览器编辑android应用程序_Android_Database_Textview - Fatal编程技术网

从浏览器编辑android应用程序

从浏览器编辑android应用程序,android,database,textview,Android,Database,Textview,我是一个新手,我想知道是否有任何方式可以添加/编辑文本以显示在电脑浏览器的文本视图中 我想做的是每天写一篇文章向用户展示。可能吗? 这是我的XML <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:

我是一个新手,我想知道是否有任何方式可以添加/编辑文本以显示在电脑浏览器的文本视图中

我想做的是每天写一篇文章向用户展示。可能吗? 这是我的XML

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@android:color/white"
    android:gravity="top"
    android:orientation="vertical" >

    <RelativeLayout
        android:id="@+id/relativeLayout1"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:background="@android:color/black" >


        <Button
            android:id="@+id/button1"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:layout_alignParentLeft="true"
            android:layout_marginLeft="50dp"
            android:background="@drawable/cdiscount"
/>

        <Button
            android:id="@+id/button2"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:layout_alignParentRight="true"
            android:layout_marginRight="50dp"
            android:background="@drawable/auchan"
 />

        <Button
            android:id="@+id/button3"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/button1"
            android:layout_marginLeft="50dp"
            android:background="@drawable/icon"
  />


        <Button
            android:id="@+id/button4"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:layout_alignBaseline="@+id/button3"
            android:layout_alignBottom="@+id/button3"
            android:layout_alignParentRight="true"
            android:layout_marginRight="50dp"
            android:background="@drawable/gb" />


        <Button
            android:id="@+id/button5"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/button3"
            android:layout_marginLeft="50dp"
            android:background="@drawable/rdc" />

        <Button
            android:id="@+id/button6"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:layout_alignBaseline="@+id/button5"
            android:layout_alignBottom="@+id/button5"
            android:layout_alignParentRight="true"
            android:layout_marginRight="50dp"
 />

        <Button
            android:id="@+id/button7"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:layout_alignParentLeft="true"
            android:layout_below="@+id/button5"
            android:layout_marginLeft="50dp"
 />

        <Button
            android:id="@+id/button8"
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:layout_alignParentRight="true"
            android:layout_below="@+id/button6"
            android:layout_marginRight="50dp"
 />
    </RelativeLayout>

</LinearLayout>

我已经编辑了xml。
所以我想做的是,当我点击一个按钮时,它会把我带到一个文本视图。我希望能够完全访问此文本视图。

您的应用程序可以在每次启动时解析/读取服务器上的数据,例如php生成的json文件。
(在本例中:twitterapi)+

我已经更新了我的答案。我想这就是你需要的

EditText myChangesToArticle的组合; TextView myArticle

将可见性设置为myChangesToArticle上的GONE

当用户点击按钮时。将可见性从过去更改为可见

编辑或输入新文章。按保存按钮

myArticle.setText(myChangesToArticle.getText()); myChangesToArticle.setVisibility(View.GONE)


为了让它在全球范围内可见,你只需在谷歌文档上更新一个远程电子表格,或者在保存时更新任何东西。并使用HttpClient从中检索。

不,不是。浏览器不知道如何与设备通信(如何使用adb)。您需要一个web服务,它将为您的应用程序提供数据(文章或其他内容)。应用程序需要实现GCM才能了解新的可用文章。Http通信和数据解析。

请明确说明您想要做什么?你想从电脑上更新你的网站,然后在应用程序中反映出来吗?我猜你需要的是一个移动网站。例如,可以使用jquerymobile进行构建。作为移动站点的所有者,您可以拥有一个只有您才能访问的编辑页面。一般用户只会看到您发布的最新文章。实际上,你可能会在Wordpress中使用一个移动友好的主题来实现这一点。当你点击一个按钮时,你会看到下面我更新的答案。一步一个脚印。我认为您需要管理EditText和TextView来完成第一部分。第二部分可能是根据您的要求将文章存储在Google文档或设备上的SharedReferences中。让我们看看用户正在尝试做什么。我猜这是一个移动网站。好的。这是交易。您需要一个EditText和一个TextEdit来执行此操作。和其他注释一样,如果应用程序中有多个用户需要在服务器端保存,但它只是自我注释,您可以在本地存储。另一个按钮用于保存编辑。保存后,隐藏EditText并用EditText中的内容替换TextView中的内容。我明白你现在想做什么了。这不是我想要的。我想你需要做的是在另一个活动中有一个编辑文本。当您单击该活动时,它将转到该活动,您可以在那里输入值。对吗?你也可以将EditText放在另一个活动中,然后执行startActivityForResult()。谢谢@Code Droid。这就是我要找的。非常感谢