Need help to display a sample card in the glass timeline(refer image). All i need is to launch the card when one taps when "ok glass" is displayed and scroll to view the card(image 2), the same via voice command also does not work.
I tried launching the same activity via adb shell it works perfectly fine, also i added an intent filter with MAIN/LAUNCHER category to the activity - it runs. I referred this link for this POC but nothing like the image is being displayed. Please help as to where am i going wrong - TIA
Activity:
package de.androidzeitgeist.glass.helloworld.immersion;
import android.app.Activity;
import android.os.Bundle;
import com.google.android.glass.app.Card;
public class HelloWorldActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Card card = new Card(this);
card.setText("Hello world!");
card.setFootnote("android.com");
setContentView(cardroid.getView());
}
}
Manifest File:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.androidzeitgeist.glass.helloworld.immersion"
android:versionCode="1"
android:versionName="1.0" >
<application
android:allowBackup="true"
android:icon="#drawable/helloworld_icon"
android:label="#string/app_name" >
<activity
android:name="de.androidzeitgeist.glass.helloworld.immersion.HelloWorldActivity"
android:icon="#drawable/helloworld_icon"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/voice_trigger" />
</activity>
</application>
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="19" />
</manifest>
voice_trigger.xml
<?xml version="1.0" encoding="utf-8"?>
<trigger keyword="#string/show_hello_word" />
strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">HelloWorldImmersion</string>
<string name="hello_world"></string>
<string name="show_hello_word">show hello world</string>
</resources>
If you are using an unregistered voice command, your manifest.xml must include
<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" />
See https://developers.google.com/glass/develop/gdk/starting-glassware for more details about using registered commands and unlisted commands and Why is my voice command missing from the ok glass menu in XE16? for some clarification and examples.
Related
I want to create a new entry under Applications and Services Log in Windows Event Viewer for my application. I used ECManGEN tool to generate the manifest and after doing the necessary steps linked it with my project. It works.. However, a folder is created with the provider name(MyTrial2 in below figure) and the channel comes under that folder. Is it possible to have only the channel without the folder?(As Internet Explorer, Microsoft Office Alerts, etc in the figure)
EDIT - Added the generated Manifest file
<?xml version="1.0" encoding="UTF-16"?>
<instrumentationManifest xsi:schemaLocation="http://schemas.microsoft.com/win/2004/08/events eventman.xsd" xmlns="http://schemas.microsoft.com/win/2004/08/events" xmlns:win="http://manifests.microsoft.com/win/2004/08/windows/events" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:trace="http://schemas.microsoft.com/win/2004/08/events/trace">
<instrumentation>
<events>
<provider name="MyTrial2" guid="{90DDCC4A-2F8A-4B57-85AF-5401E678708A}" symbol="MyTrial2" resourceFileName="E:\MyEventTrial\MyEventTrial\Debug\MyEventTrial.exe" messageFileName="E:\MyEventTrial\MyEventTrial\Debug\MyEventTrial.exe">
<events>
<event symbol="EvenEvent2" value="1" version="0" channel="TrialChannel2" level="win:Informational" message="$(string.MyTrial.event.1.message)">
</event>
<event symbol="OddEvent2" value="2" version="0" channel="TrialChannel2" level="win:Informational" message="$(string.MyTrial.event.2.message)">
</event>
<event symbol="ErrorEvent2" value="3" version="0" channel="TrialChannel2" level="win:Error" message="$(string.MyTrial.event.3.message)">
</event>
</events>
<levels>
</levels>
<channels>
<channel name="TrialChannel2" chid="TrialChannel2" symbol="TrialChannel2" type="Admin" enabled="true">
</channel>
</channels>
</provider>
</events>
</instrumentation>
</instrumentationManifest>
First I want to say that I am new in android, I have a lot of troubles with android action bar I am trying to not getting null on this line:
ActionBar actionBar = getActionBar();
I tried everything. I understand that it's returning null because the theme is not suitable to the theme of the activity. I don't know how to set a different theme to each one, but after I found a way to avoid this problem I got another problem. What I am trying to do is actionbar, and a tab bar, now I can't see the icons in the action bar, I see them in the overflow.
onCreate:
public class MainViewActivity extends Activity implements RoutesFragment.OnFragmentInteractionListener ,GroupsFragment.OnFragmentInteractionListener
,VideosFragment.OnFragmentInteractionListener,PhotosFragment.OnFragmentInteractionListener
{
private final CharSequence charSequence[] = {"Profile", "New route", "My route", "Liked route", "GroupsFragment", "Settings", "About CTwalk"};
private String charSequence2;
#Override
protected void onCreate(Bundle savedInstanceState) {
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_view);
getOverflowMenu();
ActionBar actionBar = getActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
Tab tab = actionBar.newTab()
.setText(R.string.tabs_Routes)
.setTabListener(new TabListener<RoutesFragment>(this, "Routes", RoutesFragment.class));
actionBar.addTab(tab);
tab = actionBar.newTab()
.setText(R.string.tabs_Groups)
.setTabListener(new TabListener<GroupsFragment>(
this, "GroupsFragment", GroupsFragment.class));
actionBar.addTab(tab);
tab = actionBar.newTab()
.setText(R.string.tabs_Photos)
.setTabListener(new TabListener<PhotosFragment>(
this, "PhotosFragment", PhotosFragment.class));
actionBar.addTab(tab);
tab = actionBar.newTab()
.setText(R.string.tabs_Videos)
.setTabListener(new TabListener<VideosFragment>(
this, "VideosFragment", VideosFragment.class));
actionBar.addTab(tab);
}
Android manidest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ctwalkapp.ctwalk" >
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name">
<activity
android:name=".MainActivity"
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=".LoginActivity"
android:label="#string/title_activity_login" >
</activity>
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name"
android:theme="#android:style/Theme.Translucent.NoTitleBar" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
<activity
android:name=".MainViewActivity"
android:label="#string/title_activity_main_view"
android:parentActivityName=".LoginActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".LoginActivity" />
</activity>
</application>
</manifest>
styles.xml:
<resources>
<style name="AppTheme" parent="#android:style/Theme.Holo.Light.DarkActionBar">
<item name="android:windowActionBar">true</item>
</style>
<style name= "MyCustomTheme" parent="android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">#style/MyActionBar</item>
</style>
<style name="MyActionBar" parent="#android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#3f51b5</item>
</style>
</resources>
im using Titanium SDK 3.3.0 and want to disable the "new" ActionBar in Android with the theme solution.
Besides a want to use a 9-Patch-Image as splashscreen/loadingscreen.
Referring to the docs and guides:
http://docs.appcelerator.com/titanium/3.0/#!/guide/Android_Action_Bar
http://docs.appcelerator.com/titanium/3.0/#!/guide/Android_Themes
I have the following Project-Setup:
files for splashscreens:
/platform/android/res/drawable-ldpi/splash.9.png
/platform/android/res/drawable-mdpi/splash.9.png
/platform/android/res/drawable-hdpi/splash.9.png
/platform/android/res/drawable-xhdpi/splash.9.png
theme file: /platform/android/res/values/gsgptheme.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.GSGP" parent="Theme.AppCompat">
<!-- Depending on the parent theme, this may be called android:windowActionBar instead of windowActionBar -->
<item name="android:windowActionBar">false</item>
<item name="android:windowBackground">#drawable/splash</item>
<item name="android:windowNoTitle">true</item>
</style>
</resources>
tiapp.xml:
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest android:installLocation="auto"
android:versionCode="21" android:versionName="3.1.1">
<application android:theme="#style/Theme.GSGP"/>
<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="14"/>
<supports-screens android:anyDensity="false"/>
</manifest>
</android>
The Problem is: Titanium doesn't seem to load my theme. On startup I see the default loadingscreen and still have an actionbar. Can anyone see my mistake?
Need to add something similar to the following in your tiapp.xml file under the android application node. Replace "YourApp" in .YourAppActivity with whatever your app name is.
<activity android:name=".YourAppActivity" android:label="#string/app_name" android:theme="#style/Theme.GSGP" android:configChanges="keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
I have followed the exact steps from the official documentation, but I still cannot get my app to start using the custom voice command. The steps are followed are:
1 Add new string resource for custom voice command in strings.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Hello World!</string>
<string name="glass_voice_trigger">start example</string>
</resources>
2 Create a new XML file for voice startup definition:
<?xml version="1.0" encoding="utf-8"?>
<trigger keyword="#string/glass_voice_trigger" />
3 Request proper permissions in AndroidManifest.xml:
<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" />
4 The manifest part looks as follows:
<service
android:name="pl.infoshare.sample.helloworld.HelloWorldService"
android:icon="#drawable/ic_lap"
android:label="#string/app_name"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/voice_trigger_start" />
</service>
Still, I am not able to start the app using the voice command. If I change to one of the predefined voice commands the app shows up on the timeline and I can start it using the voice command. Did I miss anything?
Looking through the question, I didn't see anything jump out at me as incorrect. So, I created a small sample GDK project that is launched with a custom voice command, and runs just fine on my XE17.1 device. (Bonus, it demos a low-frequency LiveCard!)
Try pulling down my sample from GitHub, and see if you can launch it with the command:
'OK Glass, start my awesome app'
Below are some of the relevant bits.
AndroidManifest.xml:
<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.DeviceDefault">
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:immersive="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<service
android:name=".LowFreqLiveCardService"
android:enabled="true"
android:exported="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name">
<intent-filter>
<action android:name=
"com.google.android.glass.action.VOICE_TRIGGER"/>
</intent-filter>
<meta-data android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/voice_trigger"/>
</service>
</application>
</manifest>
res/xml/voice_trigger.xml:
<?xml version="1.0" encoding="utf-8"?>
<trigger keyword="#string/custom_keyword" />
res/values/strings.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Low Freq Demo</string>
<string name="heart_rate">Heart Rate</string>
<string name="custom_keyword">start my awesome app</string>
</resources>
Here's a link to the voice command documentation, it still provides instructions on using custom voice commands. And, from my testing, they still do work.
Custom voice commands require, since a couple of versions ago, the aproval from google. You can send a request for that aproval from the glass developer site.
Review this.
I'm having some trouble creating some custom web services in Magento. I'm trying to get the module configured properly and I can't seem to make the web services I've defined in the api.xml file show up under the user role setup in the admin area.
I've defined a custom module in app/etc shown here
ctp_GiftCards.xml:
<?xml version="1.0"?>
<config>
<modules>
<ctp_GiftCards>
<active>true</active>
<codePool>local</codePool>
</ctp_GiftCards>
</modules>
</config>
The module code is located in app/local/ctp/GiftCards/
Here is an example of the etc/api.xml:
<?xml version="1.0"?>
<config>
<api>
<resources>
<GiftCards translate="title" module="ctp_GiftCards">
<title>GiftCard webservices</title>
<acl>GiftCards/GiftCard</acl>
<methods>
<update translate="title" module="ctp_GiftCards">
<title>updates a giftcard account</title>
</update>
</methods>
<faults module="ctp_GiftCards">
<invalid_data>
<code>100</code>
<message>giftcard data invalid</message>
</invalid_data>
<card_pool_error>
<code>101</code>
<message>card pool for entry not updated</message>
</card_pool_error>
<cache_error>
<code>102</code>
<message>cache not reset</message>
</cache_error>
</faults>
</GiftCards>
</resources>
<acl>
<resources>
<GiftCards translate="title" module="ctp_GiftCards">
<title>GiftCards</title>
<sort_order>6</sort_order>
<GiftCard translate="title" module="ctp_GiftCards">
<title>GiftCard</title>
<update translate="title" module="ctp_GiftCards">
<title>Update</title>
</update>
</GiftCard>
</GiftCards>
</resources>
</acl>
</api>
</config>
and the etc/config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<ctp_GiftCards>
<version>0.1.0</version>
</ctp_GiftCards>
</modules>
<global>
<models>
<GiftCard>
<class>CTP_GiftCards_Model</class>
</GiftCard>
</models>
</global>
</config>
Any help would be much appreciated.
--edit--
I'm using mangeto pro 1.10
Don't use capital letter (GiftCards) in the name of xml tag inside the node. Moreover, your module's name contains both underscope (_) and capital letter (ctp_GiftCards) which will lead Magento to misunderstand.