I have an unclaimed bounty for this question. If someone is able to provide a working answer that meets my criteria, I will reward them with the bounty. It’s not visible because the bounty expired, but I can reward it after the fact to an acceptable answer.
My app has intent filters set up that work as desired when I use Chrome. Unfortunately, Firefox does not implement deep links the same way. When I tap a link in Firefox, it shows a little Android icon at the end of the address bar. If I tap that, it will open my app in Firefox and I don't like this behavior. With Chrome, it simply opens the app (after prompting you to choose the app the first time)
UPDATE: singletask does not work and it has the heinous side effect of the resuming activity not being able to get the extras from the intent that launched it.
This is not a duplicate of other deep link Firefox questions (this, this, this, this, this, this, and this) because those questions are about how to get deep links to work at all whereas I understand how deep links work in Firefox and they already work for me, but I want to change the behavior...
I'm asking: How, if possible, can I open the existing instance of my app via deep link from Firefox and have it behave the same way that it does with Chrome? I don't want use an iframe.
I have implemented http and https intent filters, like so:
<!-- https -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="myappurl"
android:pathPrefix="/myprefix"
android:scheme="https" />
</intent-filter>
<!-- http -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="myappurl"
android:pathPrefix="/myprefix"
android:scheme="http" />
</intent-filter>
If you're going to provide a solution, please provide a clear example that includes context as to where the code should go in the manifest (if at all), and what the side effects are (see my link above- singletask does not work for this)
You have to put android:launchMode="singleTask" under your activity tag.
This prevents opening multiple instances. If your app is already open it will launch it, else it will create a new instance.
Related
I set the SupportsPinning to true for outlook addins by modifying the manifest file as shown below. This allows the pin icon available. By default, the Pin is not selected. So is there a way to have the addins PINNED right away?
<!-- Task pane button -->
<Control xsi:type="Button" id="msgReadOpenPaneButton">
......
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="readTaskPaneUrl" />
<SupportsPinning>true</SupportsPinning>
</Action>
</Control>
Nope. Users are responsible for pinning the task pane. The add-in just provides such ability. I'd suggest filing a feature request at https://aka.ms/M365dev-suggestions .
I'm an Android developer and I'm trying to develop a custom Android Auto app, that does a simple mirroring of the phone screen.
I know that currently the API are only available for music and messaging apps, but I would write an app for mirror a simple "hello world".
I follow the Google Getting Started tutorial and I'm using the Desktop Head Unit (DHU) provided by Google (at developer.android.com/training/auto/testing/index.html)
but when I tap last button on the bottom of the display and select "All car apps", my application doesn't appear on the list.
All car apps
For example, if Android Auto is launched in a Samsung tablet (SM-T555), the DHU lists these app:
com.google.android.gms, Maps, System UI, Video, SampleAuthenticatorService, SecureSampleAuthService, Screen capture, Android Auto, Phone, Media, Return to Google, Samsung Billing, Google App, Google Play Music, Music
Available Car Apps in a Samsung Tablet
How can I make an app that is displayed on the available app list in Android Auto? Is possible do mirroring for a custom app in Android Auto?
Create a service like this:
public class HelloWorldService extends CarActivityService {
#Override
public Class<? extends CarActivity> getCarActivity() {
return HelloWorldAutoActivity.class;
}
}
Then add the service to your manifest like this:
<meta-data
android:name="com.google.android.gms.car.application"
android:resource="#xml/automotive_app_desc" />
<service
android:name=".HelloWorldService"
android:exported="true"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="com.google.android.gms.car.category.CATEGORY_PROJECTION" />
<category android:name="com.google.android.gms.car.category.CATEGORY_PROJECTION_OEM" />
</intent-filter>
</service>
Finally create a xml file called automotive_app_desc under your res folder:
<automotiveApp>
<uses name="service" />
<uses name="projection" />
<uses name="notification" />
</automotiveApp>
Your HelloWorldAutoActivity.class will work as your MainActivity.
Android auto not customized. some api (audio, map, contacts) are same, customized.but you can dolittle things. pls check this
https://github.com/Mutesham/AndroidAuto_TextApp
In order to have app displayed on the Auto. You will have to upload it to playstore on beta channel.
The Main Activity File
The main activity code is a Java file MainActivity.java. This is the actual application file which ultimately gets converted to a Dalvik executable and runs your application. Following is the default code generated by the application wizard for Hello World! application −
package com.example.helloworld;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
The Manifest File
Whatever component you develop as a part of your application, you must declare all its components in a manifest.xml which resides at the root of the application project directory. This file works as an interface between Android OS and your application, so if you do not declare your component in this file, then it will not be considered by the OS. For example, a default manifest file will look like as following file −
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.tutorialspoint7.myapplication">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
The Strings File
The strings.xml file is located in the res/values folder and it contains all the text that your application uses. For example, the names of buttons, labels, default text, and similar types of strings go into this file. This file is responsible for their textual content. For example, a default strings file will look like as following file −
<resources>
<string name="app_name">HelloWorld</string>
<string name="hello_world">Hello world!</string>
<string name="menu_settings">Settings</string>
<string name="title_activity_main">MainActivity</string>
</resources>
The Layout File
The activity_main.xml is a layout file available in res/layout directory, that is referenced by your application when building its interface. You will modify this file very frequently to change the layout of your application. For your "Hello World!" application, this file will have following content related to default layout −
<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" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:padding="#dimen/padding_medium"
android:text="#string/hello_world"
tools:context=".MainActivity" />
</RelativeLayout>
I am trying to develop a firefox extension that adds a panel allowing the user to interact with the DOM of any webpage. I'd like to reuse web components that I've already built. The web components are built using libraries like jquery, angular, d3, and a bunch of others, most of which don't play nice with XUL. To deal with that, I'm including a browser element that contains a web page with my components.
<overlay id="testOverlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<hbox id="browser">
<splitter></splitter>
<vbox flex="1">
<browser
src="chrome://testApp/content/index.html"
type="content"
flex="1"/>
</vbox>
</hbox>
</overlay>
This works, and shows my index.html in a panel to the side as expected. However, I cannot figure out how to debug any scripts that are included on the index.html page. The documentation for debugging extensions seems very sparse.
So the question I have is: how can I point the firefox debugger at the browser element in the pane that I've created.
Follow the instructions here for enabling the browser (as opposed to content) debugger: https://developer.mozilla.org/en-US/docs/Debugging_JavaScript#JavaScript_Debugger
Once your scripts are loaded in the browser, they should become visible in the debugger's sources pane (but not before that).
If you still can't get that to work, I would love a test case and detailed steps to reproduce, so I could try and diagnose the problem :)
Magento's (1.5.1.0) cms_footer_links link to wishlist is incorrect: it points to the web root instead of "/wishlist". I have been able to apply a temporary fix (on wishlist.xml: the commented action was replaced by the uncommented action below it)
<reference name="top.links">
<block type="wishlist/links" name="wishlist_link"/>
<!-- <action method="addLinkBlock"><blockName>wishlist_link</blockName></action> -->
<action method="addLink" translate="label title"><label>My Wishlist</label><url>wishlist</url><title>My Wishlist</title><prepare/><urlParams/><position>20</position></action>
</reference>
Fixing it this way naturally doesnt show the number of items in the wishlist on the link. How do I go about fixing <blockName>wishlist_link</blockName> without changing the core xml responsible for it? I imagine it can be done via local.xml (this did not work), but what is the syntax for doing that?
An alternative solution would be to find the reason why it stopped working, but that can be a much more daunting task than modifying local.xml. I have been able to find other people with the exact same problem on the magento forum (1, 2), but I've given up on asking for help there...
Is it possible to disable certain modules when running a certain theme? I'm working on a mobile friendly version of our Magento store and I've run into some issues with a few extensions. Rather than customize them, the default iphone theme is sufficient, so I'd like to just disable those modules so it runs the default code when on a mobile device. Is this possible? If not, perhaps I'm approaching this from the wrong angle. What is the right way to handle this type of thing?
It sounds like you need to look into the Exceptions portion of the System configuration, you should be able to at least setup some conditions for mobile user agents.
An Article I wrote a while back on using the iphone theme for android may help shed some light for you:
http://www.molotovbliss.com/iphone-magento-theme-compatible-with-android
As far as disabling modules based of the exceptions sounds like you'll need to manage the modules etc/ xml files to set <active>true</active> to <active>false</active> when needed, however I believe you could disable the output of the module via a built in method also.
Hope this helps.
Brian, I think you can do it using local.xml file that is template dependent.
Here are some examples from my file:
<default>
<reference name="left">
<remove name="left.newsletter" />
</reference>
</default>
When you use the remove tag, it removes any blocks with the specified name from
the entire layout, regardless of the context. So, if I remove right.newsletter in
the context and that name is used in say the context,
then both blocks will be removed. Because remove operates on the global context,
you can only remove an element once.