|
thientamtita wrote: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.gson.JsonElement Check which reference is null.
|
|
|
|
|
|
Have you looked at line 104 of MainActivity.java? What size is jsonArray (is it >= 2)? What is the value of messagex and ChatMessages ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
android src code for bluetooth file and data transfer
|
|
|
|
|
42 message received all your base are belong to us resistance is futile
|
|
|
|
|
Thanks for this advice. I will reward you.
|
|
|
|
|
|
I have small project using SignalR wrote C# (using Xamarin in Visual Studio 2013)
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Microsoft.AspNet.SignalR.Client;
using System.Collections.Generic;
namespace SignalRWithXamarin
{
[Activity(Label = "SignalRWithXamarin", MainLauncher = true)]
public class MainActivity : Activity
{
HubConnection chatConnection;
IHubProxy SignalRChatHub;
public event EventHandler<string> OnMessageReceived;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
chatConnection = new HubConnection("http://www.mynotyfy.somee.com/");
SignalRChatHub = chatConnection.CreateHubProxy("ChatHub");
SignalRChatHub.On("broadcastMessage", (string name, string message) =>
{
if (OnMessageReceived != null)
OnMessageReceived(this, string.Format("{0}: {1}", name, message));
});
var input = FindViewById<EditText>(Resource.Id.ChatInput);
var messages = FindViewById<ListView>(Resource.Id.ChatMessages);
var adapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, new List<string>());
JoinChat();
messages.Adapter = adapter;
OnMessageReceived += (sender, message) => RunOnUiThread(() =>
adapter.Add(message));
Button button = FindViewById<Button>(Resource.Id.ChatButton);
button.Click += delegate
{
if (string.IsNullOrEmpty(input.Text))
return;
Chat(input.Text);
input.Text = "";
};
}
public async virtual void JoinChat()
{
try
{
await chatConnection.Start();
}
catch (Exception)
{
}
}
public async virtual void Chat(string phoneChatMessage)
{
if (chatConnection.State == ConnectionState.Connected)
await SignalRChatHub.Invoke("Send", "Android", phoneChatMessage);
}
}
}
Now I wanna Convert to Project in Eclipse.
|
|
|
|
|
thientamtita wrote: Now I wanna Convert to Project in Eclipse. Then please feel free to do so. The eclipse system will generate a standard framework for your app and you just need to fill in the specifics of your code.
|
|
|
|
|
Calling anyone with Google Glass app development, design, or testing experience. I need participants for a quick card sort regarding glass application design principles. It takes less than 10 minutes to do and your participation is highly appreciated! Thank you.
The card sort can be found here:
https://704302s2.optimalworkshop.com/optimalsort/glassdesignprinciples
|
|
|
|
|
|
how to make a web browser for android 4.4 OS?
|
|
|
|
|
Are you sure that is what you mean? Creating a web browser is rather a lot of work.
|
|
|
|
|
hey all. I am new in android programming. i tried to fill a listview with the datas that i pull from a Xml. I did almost everything and it works fine for now. But the images(320 X 230) in Listview can be seen in some devices(Samsung Galaxy Note 2 but imitation one) and in some devices cant be seen(Samsung Galaxy Note 3, HTC One M7, Samsung Galaxy S4) Can it be because of resolution problems or any other reason ?
vemedya.com
|
|
|
|
|
[edit]
I edited this message and it is now (incorrectly) under my name!
Can't find a way to go back to the original user.
[/edit]
package com.example.abcpos;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.GridView;
public class OrderMenu extends Activity {
private GridView gridView;
private GridViewAdapter customGridAdapter;
<a href="http://www.codeproject.com/Members/override">@Override</a>
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_order_menu);
:sigh: :sigh: :sigh:
gridView = (GridView) findViewById(R.id.??????)
}
<a href="http://www.codeproject.com/Members/override">@Override</a>
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.order_menu, menu);
return true;
}
<a href="http://www.codeproject.com/Members/override">@Override</a>
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.abcpos.OrderMenu" >
<GridView
android:id="@+id/grdOrderMenu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:numColumns="3" />
</RelativeLayout>
Sign
modified 21-Nov-14 11:20am.
|
|
|
|
|
Richard MacCutchan wrote: I edited this message and it is now (incorrectly) under my name! How were you able to edit it if it did not already belong to you?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Some of us have extra privileges.
|
|
|
|
|
Can anyone tell me how to implement ListFragment with corresponding detailed fragments. I want to display listview in one side of the tablet when onclick of list item it should display corresponding xml layouts in same activity.
-- modified 18-Nov-14 1:47am.
|
|
|
|
|
Are you using Eclipse or Android Studio? Both have a Master/Detail Flow option when creating a new project. Try that to see what it puts together for you.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Then please go ahead and do it, and stop posting these non-questions here.
|
|
|
|
|
my project asp.net web base project complate...my web project attach android application..
then working same same web and android ?????????
,so i want help from android application????
,give me lots of ideas....
|
|
|
|
|
It starting to be a bit annoying - don't you think so!
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
תפסיק לספר לה' כמה הצרות שלך גדולות, תספר לצרות שלך כמה ה' גדול!
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
owais_ahmed_ansari wrote: give me lots of ideas Here are a couple:
|
|
|
|
|
Hi!I have in MainActivity textView,whole show contents files (which located in the folder). I need show contents next file (which located in the folder) when click on button. I hope the problem is clear)))
Thanks in advance.
P.S. Now code looks like this:
TextView myTv;
String res = "";
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.universal);
myTv = (TextView) findViewById(R.id.textView);
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(
getAssets().open("universal")));
String myLine = reader.readLine();
while (myLine != null) {
res += myLine + "\n";
myLine = reader.readLine();
}
reader.close();
} catch (IOException e) {
Toast.makeText(getApplicationContext(),
"Error Opening the File !!!", Toast.LENGTH_LONG).show();
}
myTv.setText(res);
modified 11-Nov-14 10:44am.
|
|
|
|
|
Kroshandowski wrote: P.S. Now code looks like this: But what's the problem? Be specific. Have you stepped through the code using the debugger?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|