|
Good Day Everyone
From my AppCompatActivity class i am trying to open an activity as an intent like this
<pre>Intent homemap = new Intent(this, typeof(HomeMap));
var fintent = new Intent(this, homemap.Class);
StartActivity(fintent);</pre>
and my manifest i have declared my Activity like this
<pre><activity
android:name=".Toletsa.HomeMap"
android:label="@string/title_activity_maps" /></pre>
and my package name in the manifest is package="com.vimalsoft.toletsa" . My assembly name is Toletsa and my namespace is Toletsa
The layout file for my Activity that i want to open as an intent is
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_privacy_policy"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.vimalsoft.toletsa.Toletsa.HomeMap">
<fragment
android:id="@+id/map"
android:layout_width="200dp"
android:layout_height="200dp"
class="com.google.android.gms.maps.MapFragment" />
</RelativeLayout>
when i run the project i get an error when starting the activity
Unhandled Exception:
Android.Content.ActivityNotFoundException: Unable to find explicit activity class {com.vimalsoft.toletsa/android.content.Intent}; have you declared this activity in your AndroidManifest.xml?
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|
|
I'm not certain about this but I have something similar, but does it this way:
Intent homemap = new Intent(this, HomeMap.class);
|
|
|
|
|
Good Day
i was able to resolve the issue i just changed this
android:name=".Toletsa.HomeMap"
in my Manifest to
android:name=".HomeMap"
and this solved my problem , the code was ok
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|
|
technology stack for Android chat application. Anyone explain it clearly.
|
|
|
|
|
Type "Android chat" into Google and you will find all the information you need.
|
|
|
|
|
Before to start building a chat app you need to focus on both Client and Server separately. Technology stack behind the Android chat application are
Server : Ejabberd
Language : Erlang
Protocol : XMPP
Database management : Mnesia & Mysql
Multimedia files storage : YAWS
Operating system : FreeBSD
|
|
|
|
|
I have to connect sql srver from my laptop in android application, what i do???
java.sql.SQLException: Unknown server host name 'Unable to resolve host'
getting above problem.
Tell me steps, hoe to connect to sql server.
|
|
|
|
|
The error message is quite clear, your host name either does not exist or cannot be reached from the client system.
|
|
|
|
|
Let us see the code you have done so far , so we correct it
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|
|
Hello,
I have a super simple php script that runs successfully when I paste the url into a browser (windows, chrome).
(http:
My php code has values hardcoded in it and these values are successfully inserted into mySql database (running on a WAMP).
At this point EVERYTHING is hardcoded in the php.
I appreciate any help, I think I am missing something fundamental (new to android development).
Problem:
I can not access/run this same script from my andoroid app. Do I need to run it async? I simply have the below code in a function that is run when the button is clicked on the phone (using an emulator so phone displays app while I am in debug mode in Android.)
Clues:
It bombs out on the last line. Strangely debug (IOException) value is blank.
Manifest has:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
*************Code Snippet
URL url;
HttpURLConnection connection = null;
url = new URL("http://xxx.xxx.xxx/myscript.php");
connection = (HttpURLConnection) url.openConnection();
connection.setReadTimeout(3000);
connection.setConnectTimeout(3000);
connection.setRequestMethod("POST");
connection.setDoInput(true);
connection.connect(); <---DIES HERE
************End Code
|
|
|
|
|
Member 13416547 wrote: Strangely debug (IOException) value is blank. Where are you catching this at? I do not see any reference to it in the code snippet you've shown.
"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
|
|
|
|
|
Sorry David, below is the full function. When I run the app on the phone it just closes down. (I reworked code and it doen't go to CATCH now.) If I comment out the
connection.connect(); line, it runs thru with no error. If I paste the url (http://xxx.xxx.xxx/myscript.php) into a browser it works and inserts a record into my table.
private void Testphp2() {
try {
URL url;
HttpURLConnection connection = null;
url = new URL("http://xxx.xxx.xxx/myscript.php");
connection = (HttpURLConnection) url.openConnection();
connection.setReadTimeout(3000);
connection.setConnectTimeout(3000);
connection.setRequestMethod("POST");
connection.setDoInput(true);
Toast.makeText(getApplicationContext(), "About to try", Toast.LENGTH_LONG).show();
connection.connect();
Toast.makeText(getApplicationContext(), "Success", Toast.LENGTH_LONG).show();
} catch (IOException e) {
e.printStackTrace();
Toast.makeText(getApplicationContext(), "error" , Toast.LENGTH_LONG).show();
}
}
|
|
|
|
|
|
Member 13416547 wrote: (I reworked code and it doen't go to CATCH now.) Because you are trying to catch a specific exception. Try using Exception instead. Have you considered the exception's getMessage() method?
Also, I suggest using Log.d() calls instead of popping up Toast messages when debugging.
"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
|
|
|
|
|
Thanks David, I will look at using Exception & getMessage as well as log.d (I am new to android dev as you can probably tell.)
|
|
|
|
|
if any one know then tell me.
when application is in background, then how to read notification?
|
|
|
|
|
Notification messages are only received in onMessageReceived() when the app is in the foreground. When the app is in the background, an automatically generated notification is displayed. When the user taps on the notification they are returned to the app.
"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
|
|
|
|
|
Thanks for reply.
But actually I want to update one value in sqlite after getting a notification. I had done code with this in message received method but problem is that, when app is in background, then I will get notification but can't update value in sqlite.
So tell me any solution.
|
|
|
|
|
Otherwise tell me how to get text or title from notification.
Or notification on click listener.
|
|
|
|
|
Malashree Halade wrote: Otherwise tell me how to get text or title from notification. The RemoteMessage parameter that is passed to onMessageReceived() .
See here for more.
"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
|
|
|
|
|
i wnt some link which i got android app develoment .
|
|
|
|
|
? ?
"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
|
|
|
|
|
Have you tried Google? Have you tried the CodeProject articles section?
|
|
|
|
|
|
Good Day All
i have a Navigation Drawer which is defined like this
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:background="#0099ff"
android:layout_height="fill_parent" />
and when one of my drawer item is selected i have this code
FragmentTransaction fragmentTx = this.FragmentManager.BeginTransaction();
Fragment1 aDifferentDetailsFrag = new Fragment1();
fragmentTx.Add(Resource.Id.content_frame, aDifferentDetailsFrag);
<pre>
fragmentTx.Commit();
Toast.MakeText(this, "Home:", ToastLength.Long).Show();</pre>
and Fragment1 is defined like this
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
<pre>
android:paddingLeft="12dp"
android:paddingRight="12dp">
<Button
android:textSize="24dp"
android:textColor="#FFF"
android:id="@+id/btn_details_file_save"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="HOME" />
and the cs is defined like this
public class Fragment1 : Fragment
{
<pre>
public override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
}
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
return inflater.Inflate(Resource.Layout.Fragment1, null, false);
}
}</pre>
when i run this , i only get a toast message, the Fragment1 does not show which has a button that is having text "home"
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|