https://cloud.google.com/developers/articles/how-to-build-mobile-app-with-app-engine-backend-tutorial/
Almost halfway down this webpage at heading "Test Client and Backend Communication", at Step 8: when i visit localhost:8888/_ah/admin/
i am not seeing any entity in the dropdown (this is my third try to this tutorial. At first two tries i would only see one entity 'MessageData' out of three.) I should see three entities, esp. CheckIn.
I am stumped. Plus, i am in the learning phase. What must i do in order to create an entity in the datastore?
Thank you in advance.
Here is the code for the MainActivity:
https://github.com/GoogleCloudPlatform/solutions-mobile-shopping-assistant-backend-java/blob/master/MobileAssistant-Tutorial/Phase1_Snippets/MainActivity.01.java
You have first to generate the Cloud EndPoint Library.
Then, you have to check if you have this lign on AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET"/>
The first classe you run when you launch an android app is define here:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<!-- Notre activité SplashScreen -->
<activity android:label="#string/app_name" android:name="com.example.test.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
Hope that help you !
Related
I'm tring to build a basic chat app in android , is my first app and i'm trying to learn
Right now i'm getting stuck at the Sign in and Sign Up interface because i have some errors in AndroidManifest.xml
here is the code :
`
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:tools="http://schemas.android.com/tools"
package="com.example.icom"/>
<application
android:allowBackup="true"
android:fullBackupContent="false"
android:icon="#mipmap/ic_launcher"
android:label="Icom Chat"
android:icon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.Icom"
tools:ignore="DataExtractionRules"
android:name=".activities.SignUpActivity"
android:windowSoftInputMode="adjustResize"
tools:ignore="MissingClass,WrongManifestParent" />
<activity
android:name=".activities.SignInActivity"
android:exported="true"
android:windowSoftInputMode="adjustResize"
tools:ignore="MissingClass,WrongManifestParent"
android:name=".MainActivity"
tools:ignore=".MissingClass,WrongManifestParent" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</manifest>
`
I receive the following errors :
Multiple root tags
Top level element is not completed
Can someone explain to me how i can fix this ?
Thank you very much .
Run the Sign In and SignUp interface for aan Chat app
It may sound stupid but i've tried a video tutorial from yt
I am just starting with android and trying to alter my android manifext .xml file such that a particular activity is launched first. My code is as follows:
<?xml version="1.0" encoding="utf-8"?>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".CrimeListActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".CrimeActivity">
</activity>
</application>
I have a CrimeListActivity java class which simply should display an empty activity. However, it continues to default to displaying the activity that was specified in the manifest originally. ( In this case, .CrimeActivity.
It's hard to be more specific without posting too much code so I'm hoping someone could give me a couple pointers on where to start poking around when issues like this arise.
Thanks!
I am making an app that communicates with a piece of usb hardware made by my company (this is the only app allowed to talk to the usb accessory, it's not a public api). I am having difficulties setting up the proper launch modes in the manifest.
There are three components to the app: the main activity, a login activity, and the USBService.
I'm assuming the intent for the main goes to the login activity, and the intent for the usb goes to the USBService, but I am not sure if I do this, will this start the service if the app is not running? More over, if it does, how do I fetch an already existing service?
What type of structure should I be looking at for the manifest file? (specifically, intent-filters, and appropriate launch modes... I've read a few documents about the launch modes but I am still not sure I quite understand... There should only ever be at most one instance of each activity/service, and they need to communicate together.
edit: it is not necessary for communications to start before the app is open, nor is it necessary to launch the app automatically when the usb is connected.
edit: my manifest as it stands, looks like:
<uses-feature android:name="android.hardware.usb.accessory" />
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name="mainpackage.MainActivity"
android:label="#string/app_name"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
</intent-filter>
<meta-data
android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
android:resource="#xml/accessory_filter" />
</activity>
<activity
android:name="mainpackage.LoginActivity"
android:label="#string/title_activity_login"
android:windowSoftInputMode="adjustResize|stateVisible" >
</activity>
<service android:name="updater.USBService"
android:exported="false" >
<!--
-->
</service>
</application>
in your manifest add
<manifest ...>
<uses-feature android:name="android.hardware.usb.host" />
<uses-sdk android:minSdkVersion="12" />
In this case, the following resource file should be saved in res/xml/device_filter.xml and specifies that any USB device with the specified attributes should be filtered:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<usb-device vendor-id="1234" product-id="5678" class="255" subclass="66" protocol="1" />
</resources>
Hope this help.
Your manifest looks good,
I think you make a good choice for putting the intent-filter "android.hardware.usb.action.USB_ACCESSORY_ATTACHED" in the mainActivity and start the application in this activity,
and again I think it's a good choice to start your mainActivity in SingleTop launch mode,
because if an instance of the mainActivity already exists at the top of the current task, the system going to launch this activity, no new instance of this activity will be created.
For a best understanding of the different launch mode available in android,
I think this link may help you :
http://www.intridea.com/blog/2011/6/16/android-understanding-activity-launchmode
To make a long story short I think you'll be all set with this manifest as is.
To Use Android Devices min SDK version should be set to 12 and need to declare following line in AndroidManifest.xml file
<>
<uses-sdk android:minSdkVersion="<version>" />
...
<application>
<uses-library android:name="com.android.future.usb.accessory" />
<activity ...>
...
<intent-filter>
<action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
</intent-filter>
<meta-data android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
android:resource="#xml/accessory_filter" />
</activity>
</application>
Can anyone tell me how to change the app name? My app is taking splash as the app name on the Emulator since my first activity is splash.
EDIT:
It takes "splash" as the app name before the app is launched. Once it is launched the right name is displayed.
Manifest:
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.sanginfo.temperatureconvertor.SplashActivity"
android:label="#string/title_activity_splash" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.sanginfo.temperatureconvertor.LoginActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.LoginActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
In your manifest file under application tag change this tag with whatever you want as a app name..android:label="#string/app_name"
use the name attribute on application node as describe in :
http://developer.android.com/guide/topics/manifest/application-element.html
#stylojack_10
Go to the File name String.xml (Project->res->values->string.xml)
change the value of the tag name app_name.
you can even make your own tag there and make change in Android Manifest file under tag find android:label="#string/"your custom app name""
Hope this will resolve your problem
Solution 1: (this solution works most of the time)
Go to res -> values -> strings.xml -> appname, change name of the app there.
No go to Android Manifest and check if it looks like this:
<application
android:label="#string/app_name"
.......................
>
If android:label="#string/app_name" is changed to android:label="MyApp", than change it to one shown above. Your problem should be solved.
Solution 2:
there was a file called OldAppName.launch
it is located in workspace/.metadata/.plugins/org.eclipse.debug.core/.launches
also stuff on:
/User/workspace/.metadata/.plugins/org.eclipse.ltk.core.refactoring/.refactorings
also a glitch in Eclipse to show old app name instead of changing the name.
I've been trying to implement the tab UI described in this tutorial: https://developer.android.com/resources/tutorials/views/hello-tabwidget.html
I follow all the steps described in the process but I keep getting a runtime exception which I believe has something to do with the fact that nowhere in the tutorial I added the extra activities (songs, artists and albums) related to the content of each tab into the android manifest file.
Am I correct? is this tutorial (like many others) faulty or incomplete?
Since they seem to update these tutorials occasionally, I wouldn't doubt they forgot to mention this part back when this question was asked. They appear to have added a mention to this requirement in the tutorial now (as of 12/20/2010) in step 2:
Duplicate this for each of the three activities, and add the corresponding tags to the Android Manifest file.
Unfortunately, since these are beginner tutorials, they should probably include what the XML tags should look like. Prior to this tutorial, they don't mention how to add activities to the manifest (though you add an activity at the end for hiding the title bar). The markup I used was identical to that on the other question mentioned in the OPs own answer:
<activity android:name=".ArtistsActivity"></activity>
<activity android:name=".AlbumsActivity"></activity>
<activity android:name=".SongsActivity"></activity>
There is a full reference on manifest activities on the Android developer site.
Well thanks for the advice, but I didn't really had to use LogCat. The tutorial is indeed faulty and incomplete, the corrections are very well explained in this related post.
Issues with Android TabHost Example
I'm just amazed by the amount of mistakes in these tutorials, and by the fact that nobody has fixed them yet.
Nelson
I was having the same problem, even after making all the corrections said above and on the following post link
the problem was the AndroidManifest, the following manifest file worked for me.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tabview.android" android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".HelloTabWidget" android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".AlbumsActivity" android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
<activity android:name=".ArtistsActivity" android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
<activity android:name=".SongsActivity" android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
</application>
</manifest>