Intent filter location - intentfilter

I'm new to Android, so I'm sorry if this is a basic question. I'm reading documentation on Common Intents and it says to add an intent filter. I've tried to look through all the folders of my project, but can't seem to find any folder that says "activity", "filter" or "manifest". Obviously I'm not looking in the right place. So my question is, if I'm making an app to send an email and I need to add this intent filter, which seems to be a XML code, where do I add it?
<activity ...>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<data android:type="*/*" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SENDTO" />
<data android:scheme="mailto" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Thanks for your help.

After much searching, intent-filter needs to go here:
app> src> main> AndroidManifest.xml>
While in manifest, intent-filter goes inside activity tags.

Related

How do you coordinate redirects between a mobile and full website?

I have a full website and recently added a mobile website. The first thing I did was to redirect calls to the full website from mobile devices to the mobile website. My web.config rules are as follows:
<rewrite>
<rules>
<clear />
<rule name="RequestBlockingRule2" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="false">
<add input="{HTTP_USER_AGENT}" pattern="ipad" />
<add input="{QUERY_STRING}" pattern="mobi" />
</conditions>
<action type="None" />
</rule>
<rule name="RequestBlockingRule1" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{HTTP_USER_AGENT}" pattern="midp|mobile|phone|android|iphone" />
</conditions>
<action type="Redirect" url="http://www.wkmclaughlin.mobi" />
</rule>
</rules>
</rewrite>
RequestBlockingRule1 looks for a mobile device in the HTTP_USER_AGENT portion of the request and redirects the request to the mobile website if it finds one; RequestBlockingRule2 intercepts requests from iPad devices and requests with “mobi” in the QUERY_STRING to prevent the redirection from occurring.
The problem is that I need to make calls to the full website from the mobile website and cannot do it with these redirects in place. I thought URL Rewrite was only for remote calls to the website, but it seems to process local requests as well. First, it can’t find AC_RunActiveContent.js; when the screen finally forms, all the graphics are gone and the remaining hyperlinks don’t do anything.
But if I temporarily remove the two rules, the full website displays properly. CAN you be routing mobile devices to your mobile website AND display your full website via your mobile site where people are using mobile devices? If so, what changes are needed in the rewrite rules?

IIS URLRewrite dynamic rule

I am trying to write an IIS URLRewrite rule that could be used dynamically using server variables instead of hard-coding. I tried several variables but can't seem to get to work.
I have a rule http://domain.com/myweb/appname/ that rewrites to http://myweb.com/appname/ which is hard-coded currently. I am hoping to have myweb and appname to be dynamic so I don't have to create a separate rule for each website and apps that I rewrite. Any help would be much appreciated.
<rule name="Inbound URL">
<match url="appname/(.*)" />
<action type="Rewrite" url="http://myweb.com/appname/{R:1}" logRewrittenUrl="true" />
<serverVariables>
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
</rule>
A little bit late, but still.. If you're after rewriting http://domain.com/xxxx/yyyy/zzzz?qqqq to http://xxxx.com/yyyy/zzzz?qqqq then it should be something like this:
<rule name="Inbound URL">
<match url="^([\da-z\.-]+)/([\/\w \.-]+)" ignoreCase="true" />
<action type="Rewrite" url="http://{R:1}.com/{R:2}" appendQueryString="true" />
</rule>
Note that ([\da-z.-]+) is meant to match only valid domain name characters. Path expression ([/\w .-]+) doesn't describe all allowed symbols, but you can always tweak it as you need.

IIS ReWrite rule based on word in url

I am trying to create some rewrite rules (IIS7 ReWrite Module) for drive-by attempts to hack the website.
My problem is that I like to keep my 404 stat clean, but currently it is filled with URL's containing "wp-admin", "fckeditor" and software like that.
I would like to make a ReWrite if the URL contains some specific words somewhere in the URL. So far I made this one that works fine. It look for the word "wp-admin" somewhere in the URL and just rewrites to the homepage.
<rule name="Handle Hacks" stopProcessing="true">
<match url=".*wp-admin.*" />
<conditions logicalGrouping="MatchAll" />
<action type="Rewrite" url="/" />
</rule>
This solution requires a seperate rule for each word. Is there a way to create just one rule that can do the trick with "wp-admin", "fckeditor", "administrator" ect.?
Thanks
You can use OR (symbol |) in your regexp like that:
<rule name="Handle Hacks" stopProcessing="true">
<match url="(wp-admin|fckeditor|administrator)" />
<action type="Rewrite" url="/" />
</rule>

Magento Hole puch With Varnish

I recently installed the varnish 3.x in system (ubuntu) and configured it to 8080.
Now full page caching is enabled and its working fine. I just want to ignore some
specific dynamic blocks of the page. How can i do with magento. Also i am not
using Magentos default caching techniques so i disabled it. also tried module Terpentine
Thanks & Regard
Rajesh Ganjeer
I have done this using
Try this in local.xml inside the app/design/frontend/XXX/XXX/layout/local.xml file:
<reference name="block name">
<action method="setEsiOptions">
<params>
<access>private</access>
<flush_events>
<wishlist_item_save_after/>
<wishlist_item_delete_after/>
<sales_quote_save_after/>
</flush_events>
</params>
</action>
</reference>`
OR
<reference name="block name">
<action method="setEsiOptions">
<params>
<access>private</access>
<ttl>0</ttl>
</params>
</action>
</reference>`
OR
<reference name="block name">
<action method="setEsiOptions">
<params>
<access>private</access>
<method>ajax</method>
</params>
</action>
</reference>`
OR
Whole page will ignore cached eg. one page module checkout_onepage_index
<checkout_onepage_index>
<turpentine_cache_flag value="0"/>
</checkout_onepage_index>
I tried this using module Nexcessnet Turpentine. and it works
For your reference after Turpentine installation :
app/design/frontend/base/default/layout/turpentine_esi.xml
Thanks a lot for your feedbacks.
Reference Sites :
http://www.magentocommerce.com/magento-connect/turpentine-varnish-cache.html
https://github.com/nexcess/magento-turpentine
Thanks & Regards
Rajesh Ganjeer
Follow this to start to end solutions for varnish
http://rajeshganjeer.wordpress.com/2014/05/28/varnish-with-magento-terpentine/
Try this in layout.xml file:
<reference name="block name">
<action method="setCacheLifetime"><s>null</s></action>
</reference>
if you want to disable in phtml file then use false after block name like this:
<?php echo $this->getChildHtml('topLinks',false) ?>
and if you want to disable from php file then use this code in specific Block class:
public function getCacheLifetime() { return null; }
Hope this helps. All the best!
Using Turpentine will be the way to go.
The specific link you are looking for is to:
https://github.com/nexcess/magento-turpentine/wiki/ESI_Cache_Policy
With the detail being:
The default ttl if not specified is a little complex: If access is
private, then if method is ajax the default ttl is 0 (not cached)
otherwise the default cookie expiration time is used. If access is
global then the default page TTL is used (regardless of method).
Implemented like:
<reference name="block name">
<action method="setEsiOptions">
<params>
<access>private</access>
<ttl>0</ttl>
</params>
</action>
</reference>

IIS7: Content-Length Mismatch Due to URL Rewrite and OutboundRules Usage

I'm having some issues getting the outbound rules configured to work on IIS7, here's the scenario that's giving me grief. My ultimate goal is to get any outboundRules working within a couple of browsers. For this example, I'm using the rule that strips .aspx from various HTML tags.
Scenario 1 (Content-Length Mismatch):
To get that particular rule to work in IIS7, I had to disable dynamic compression and turn caching off by default. I was successful in getting the HTML rewritten, but another issue cropped up that makes this unusable.
When trying the rewrite content with outboundrules, I'm getting an issue where by Chrome and Firefox are performing a continuous load because of a "content-length mismatch" in the headers (Thanks Fiddler for helping me identify it). The rewrite works, but it causes the content length to be incorrect and so those two browsers look like they're loading forever. Chrome in particular this causes an issue because javascript appears to be hung up and so anything jquery doesn't work until someone physically hits the stop button.
This is the pertinent sections of the web.config that I began with in order to give me that scenario:
<system.webServer>
<rewrite>
<urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" />
<modules runAllManagedModulesForAllRequests="true" />
<outboundRules>
<rule name="Remove .aspx from links in the response" preCondition="IsHTML" stopProcessing="false">
<match filterByTags="A, Area, Base, Form, Frame, IFrame, Link, Img, Script" pattern="(.*)\.aspx(\?.*)?$" />
<action type="Rewrite" value="{R:1}{R:2}" />
</rule>
<preConditions>
<preCondition name="IsHTML">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
<caching enabled="false" enableKernelCache="false" />
</system.webServer>
While researching this issue, I found this stackedoverflow question which mentioned the rewriteBeforeCache="true" attribute on the outboundRules tag as well as this blog post which laid out the same thing that I was running into with the content-length issues.
If I modify that attribute, that leads me to Outbound Rules failing to work any further.
Scenario 2 (Outbound Rules do not work):
So because of the prior information, I began tweaking the web.config and was able to resolve the content-length mismatch by using the rewriteBeforeCache attribute on the outboundRules tag. To get that attribute to work, I was able to turn caching back on. That fixed the reponse-length mismatch from Scenario 1, but now none of the outboundRules\rule elements appear to work. I have tried a number of the simplest rules and they function just fine when I remove the rewriteBeforeCache attribute, but that causes Scenario 1:
<system.webServer>
<rewrite>
<urlCompression doStaticCompression="false" doDynamicCompression="true" dynamicCompressionBeforeCache="false" />
<modules runAllManagedModulesForAllRequests="true" />
<outboundRules rewriteBeforeCache="true">
<rule name="Remove .aspx from links in the response" preCondition="IsHTML" stopProcessing="false">
<match filterByTags="A, Area, Base, Form, Frame, IFrame, Link, Img, Script" pattern="(.*)\.aspx(\?.*)?$" />
<action type="Rewrite" value="{R:1}{R:2}" />
</rule>
<preConditions>
<preCondition name="IsHTML">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
</system.webServer>
Scenario 1 causes one error with browsers in IIS7; Scenario 2 causes outboundrules to stop working.
I have modified any number of options with disabling caching, chunk-mode transfers, and trying every combination I can think to try.
Additional notes on AppPool: IIS7, .NET4.0, Classic pipeline
Does anyone else have any ideas as to what other options I have to address this beyond moving to an IIS7.5 server?

Resources