<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Subodh Pushpak&#039;s Blog</title>
	<atom:link href="https://subodhnpushpak.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://subodhnpushpak.wordpress.com</link>
	<description>Technical musings on Architecture, Azure, Mobile and everything in between</description>
	<lastBuildDate>Thu, 16 Oct 2025 18:20:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='subodhnpushpak.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>https://secure.gravatar.com/blavatar/34f61d799bece929cc32032ad0b6fae738dcae65fb007f624bb875cd544b8545?s=96&#038;d=https%3A%2F%2Fs0.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Subodh Pushpak&#039;s Blog</title>
		<link>https://subodhnpushpak.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="https://subodhnpushpak.wordpress.com/osd.xml" title="Subodh Pushpak&#039;s Blog" />
	<atom:link rel='hub' href='https://subodhnpushpak.wordpress.com/?pushpress=hub'/>
	<item>
		<title>Build Coding Agent for enterprise level microservices</title>
		<link>https://subodhnpushpak.wordpress.com/2025/10/16/build-coding-agent-for-enterprise-level-microservices/</link>
					<comments>https://subodhnpushpak.wordpress.com/2025/10/16/build-coding-agent-for-enterprise-level-microservices/#respond</comments>
		
		<dc:creator><![CDATA[Subodh N Pushpak]]></dc:creator>
		<pubDate>Thu, 16 Oct 2025 18:20:39 +0000</pubDate>
				<category><![CDATA[Metro Apps, Win8, ASP .NET Web API, iOS, iPAd]]></category>
		<category><![CDATA[ai]]></category>
		<category><![CDATA[artificial-intelligence]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[technology]]></category>
		<guid isPermaLink="false">http://subodhnpushpak.wordpress.com/?p=783</guid>

					<description><![CDATA[“What if your AI could write, test, and commit microservices code like a seasoned engineer?”Welcome to the future of software engineering—where agentic AI meets microservices. In this post, we’ll walk through how to build a Coding Agent using Azure AI Foundry, complete with a professional-grade architecture and real-world Azure CLI commands to get you started. &#8230; <a href="https://subodhnpushpak.wordpress.com/2025/10/16/build-coding-agent-for-enterprise-level-microservices/" class="more-link">Continue reading <span class="screen-reader-text">Build Coding Agent for enterprise level&#160;microservices</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p>“What if your AI could write, test, and commit microservices code like a seasoned engineer?”<br>Welcome to the future of software engineering—where agentic AI meets microservices. In this post, we’ll walk through how to build a Coding Agent using Azure AI Foundry, complete with a professional-grade architecture and real-world Azure CLI commands to get you started.</p>



<hr class="wp-block-separator has-alpha-channel-opacity" />



<p><strong><img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f9e0.png" alt="🧠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The Vision: AI That Codes Microservices</strong><br>Imagine asking your AI:<br>“Create a new microservice for user onboarding with REST APIs, integrated with our existing auth service.”<br>And it responds with:<br>• A fully scaffolded microservice<br>• Integrated with your existing codebase<br>• Tested and committed to your GitHub repo</p>



<p><br>This is the power of agentic AI + RAG (Retrieval-Augmented Generation) + Azure AI Foundry<br>In the era of AI-augmented software engineering, agentic AI systems are transforming how we build, maintain, and scale microservices. This post walks through the architecture of a Coding Agent—a specialized AI system that can reason, retrieve, and generate code for microservices—using the Azure AI Foundry ecosystem.</p>



<p><br><strong><img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f680.png" alt="🚀" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Why Build a Coding Agent?</strong><br>Modern microservices architectures are complex, distributed, and constantly evolving. Developers often spend significant time:<br>• Searching for existing code patterns<br>• Understanding service dependencies<br>• Writing boilerplate or repetitive code<br>• Debugging and interpreting logs<br>A Coding Agent can automate and accelerate these tasks by combining retrieval-augmented generation (RAG), code interpretation, and contextual memory.</p>



<p><strong>Architecture: Agentic AI RAG Workflow</strong></p>



<figure class="wp-block-image size-large"><img width="683" height="1024" data-attachment-id="785" data-permalink="https://subodhnpushpak.wordpress.com/2025/10/16/build-coding-agent-for-enterprise-level-microservices/codingagentarchdiagram/" data-orig-file="https://subodhnpushpak.wordpress.com/wp-content/uploads/2025/10/codingagentarchdiagram.png" data-orig-size="1024,1536" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="codingagentarchdiagram" data-image-description="" data-image-caption="" data-medium-file="https://subodhnpushpak.wordpress.com/wp-content/uploads/2025/10/codingagentarchdiagram.png?w=200" data-large-file="https://subodhnpushpak.wordpress.com/wp-content/uploads/2025/10/codingagentarchdiagram.png?w=683" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2025/10/codingagentarchdiagram.png?w=683" alt="" class="wp-image-785" srcset="https://subodhnpushpak.wordpress.com/wp-content/uploads/2025/10/codingagentarchdiagram.png?w=683 683w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2025/10/codingagentarchdiagram.png?w=100 100w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2025/10/codingagentarchdiagram.png?w=200 200w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2025/10/codingagentarchdiagram.png?w=768 768w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2025/10/codingagentarchdiagram.png 1024w" sizes="(max-width: 683px) 100vw, 683px" /></figure>



<p><strong><img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f9e9.png" alt="🧩" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Architecture Overview</strong><br>Here&#8217;s a high-level view of the Agentic AI RAG Workflow for a Coding Agent:<br>Key Components:</p>



<ol class="wp-block-list">
<li>Coding Agent<br>The user-facing interface that receives prompts like “Generate a new API for user onboarding.”</li>



<li>Agent Orchestrator<br>Built using Azure AI Orchestrator, this component coordinates tool selection, memory access, and reasoning steps.</li>



<li>Search Tool<br>Powered by Azure AI Search, it retrieves relevant code snippets, documentation, or design patterns from internal repositories.</li>



<li>Context Manager<br>Maintains conversational and task context using Azure OpenAI GPT with function calling and prompt chaining.</li>



<li>Code Interpreter Tool<br>Executes and validates code using Azure Container Apps or Azure Functions, enabling real-time feedback and testing.</li>



<li>Memory Layer<br>Combines:<br>o Short-Term Memory: Session cache using Azure Redis Cache<br>o Long-Term Memory: Persistent vector embeddings stored in Azure AI Search Vector Index or Azure Cosmos DB for PostgreSQL with pgvector</li>



<li>Vector Store Tool<br>Manages embeddings using Azure AI Embeddings and Cognitive Search for similarity-based retrieval.</li>



<li>Knowledge Layer<br>Houses:<br>o Similarity Search: Finds semantically similar code or documentation<br>o Embeddings: Generated using OpenAI’s Ada v3 or Cohere Embed<br>o Recursive Retrieval: Enables multi-hop reasoning across services and APIs</li>



<li>Code Repository<br>Integrates with Azure DevOps Repos or GitHub Enterprise for version control and codebase access.<br><img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f6e0.png" alt="🛠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Azure AI Foundry<br>Azure AI Foundry provides a modular, composable framework for building agentic systems. Here&#8217;s how it supports our Coding Agent:<br>Azure AI Foundry Component Role in Coding Agent<br>Orchestrator Manages tool routing and reasoning<br>Memory Plugin Integrates Redis and Vector DBs<br>Tooling Interface Connects to Search, Code Interpreter, etc.<br>Prompt Flow Designs multi-step reasoning chains<br>Function Calling Enables dynamic tool invocation<br>Observability Tracks agent decisions and tool usage</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity" />



<p><strong>Setting Up the Components with Azure CLI</strong><br>Let’s break down the setup using Azure services.</p>



<ol class="wp-block-list">
<li>Azure AI Search (Search Tool + Vector Store)</li>
</ol>



<h1 class="wp-block-heading">Create a resource group</h1>



<p>az group create &#8211;name coding-agent-rg &#8211;location eastus</p>



<h1 class="wp-block-heading has-medium-font-size"><strong>Create Azure Cognitive Search service</strong></h1>



<p>az search service create \<br>&#8211;name coding-agent-search \<br>&#8211;resource-group coding-agent-rg \<br>&#8211;sku standard \<br>&#8211;location eastus</p>



<h1 class="wp-block-heading has-medium-font-size">Create a vector index (assumes schema is defined in index.json)</h1>



<p>az search index create \<br>&#8211;name code-index \<br>&#8211;service-name coding-agent-search \<br>&#8211;resource-group coding-agent-rg \<br>&#8211;body @index.json</p>



<ol start="2" class="wp-block-list">
<li><strong>Azure OpenAI (LLM + Embeddings)</strong></li>
</ol>



<h1 class="wp-block-heading has-medium-font-size">Create Azure OpenAI resource</h1>



<p>az cognitiveservices account create \<br>&#8211;name codingAgentOpenAI \<br>&#8211;resource-group coding-agent-rg \<br>&#8211;kind OpenAI \<br>&#8211;sku S0 \<br>&#8211;location eastus \<br>&#8211;yes</p>



<h1 class="wp-block-heading has-medium-font-size">Deploy GPT-4 and Embedding model</h1>



<p>az cognitiveservices account deployment create \<br>&#8211;resource-group coding-agent-rg \<br>&#8211;name codingAgentOpenAI \<br>&#8211;deployment-name gpt4-deployment \<br>&#8211;model-name gpt-4 \<br>&#8211;model-version &#8220;latest&#8221; \<br>&#8211;model-format OpenAI</p>



<p>az cognitiveservices account deployment create \<br>&#8211;resource-group coding-agent-rg \<br>&#8211;name codingAgentOpenAI \<br>&#8211;deployment-name embedding-deployment \<br>&#8211;model-name text-embedding-ada-002 \<br>&#8211;model-version &#8220;latest&#8221; \<br>&#8211;model-format OpenAI</p>



<ol start="3" class="wp-block-list">
<li>Azure Redis (Short-Term Memory)</li>



<li>Azure Cosmos DB with pgvector (Long-Term Memory)</li>
</ol>



<h1 class="wp-block-heading has-medium-font-size">Create Cosmos DB </h1>



<p>az cosmosdb postgres server create \<br>&#8211;name codingAgentCosmos \<br>&#8211;resource-group coding-agent-rg \<br>&#8211;location eastus \<br>&#8211;sku-name Standard_B1ms \<br>&#8211;admin-user myadmin \<br>&#8211;admin-password MySecurePassword123</p>



<h1 class="wp-block-heading has-medium-font-size">Enable pgvector extension</h1>



<h1 class="wp-block-heading has-medium-font-size">(This step is done via SQL command in the database)</h1>



<ol start="5" class="wp-block-list">
<li>Azure Container Apps (Code Interpreter Tool)</li>
</ol>



<p><strong><img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f9ea.png" alt="🧪" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Use Case: Auto-Generating Microservice APIs</strong><br>Prompt: “Create a new microservice for user profile management with CRUD APIs.”<br>Agent Flow:</p>



<ol class="wp-block-list">
<li>Search Tool retrieves similar services from the monorepo.</li>



<li>Context Manager identifies dependencies and naming conventions.</li>



<li>Code Interpreter Tool generates and validates the API scaffold.</li>



<li>Memory Layer stores the session for future refinement.</li>



<li>Code Repository commits the generated code to a feature branch.</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity" />



<p><strong>Example: Coding Agent that writes Kotlin microservices and generates PDFs on the fly.</strong><br>import org.springframework.http.HttpHeaders<br>import org.springframework.http.MediaType<br>import org.springframework.http.ResponseEntity<br>import org.springframework.web.bind.annotation.*<br>import org.springframework.beans.factory.annotation.Autowired</p>



<p>@RestController<br>@RequestMapping(&#8220;/api/report&#8221;)<br>class ReportController(@Autowired private val pdfReportService: PdfReportService) {</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: plain; title: ; notranslate">
@PostMapping("/generate", produces = &#91;MediaType.APPLICATION_PDF_VALUE])
fun generateReport(@RequestBody formData: FormData): ResponseEntity&lt;ByteArray&gt; {
    val pdfBytes = pdfReportService.generatePdf(formData)

    return ResponseEntity.ok()
        .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=form-report.pdf")
        .contentType(MediaType.APPLICATION_PDF)
        .body(pdfBytes)
}
</pre></div>


<p>}</p>



<p><img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f9ed.png" alt="🧭" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Best Practices<br>• Guardrails: Use Azure AI Content Filters and Prompt Shields to prevent hallucinations or unsafe code.<br>• Human-in-the-loop: Integrate with Azure DevOps Pipelines for review and approval workflows.<br>• Telemetry: Leverage Azure Monitor and Application Insights to track agent performance and usage.</p>



<hr class="wp-block-separator has-alpha-channel-opacity" />



<p><strong><img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f52e.png" alt="🔮" class="wp-smiley" style="height: 1em; max-height: 1em;" /> What’s Next?</strong><br>With Azure AI Foundry and the architecture above, you can build intelligent agents that:<br>• Understand your codebase<br>• Generate and test code<br>• Learn from past interactions<br>• Scale across teams and services</p>



<p><br><strong>Future enhancements could include:</strong><br>• Multi-agent collaboration (e.g., Planner + Coder + Tester agents)<br>• Natural language debugging<br>• Autonomous refactoring suggestions</p>
]]></content:encoded>
					
					<wfw:commentRss>https://subodhnpushpak.wordpress.com/2025/10/16/build-coding-agent-for-enterprise-level-microservices/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/ca4dffc06c2219965b6c16d8705646c48cfbbec0bd22d82033a3b4cd4ed6f404?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">subodhnpushpak</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2025/10/codingagentarchdiagram.png?w=683" medium="image" />
	</item>
		<item>
		<title>Flutter continuous build / deployment using AppCenter</title>
		<link>https://subodhnpushpak.wordpress.com/2019/07/31/flutter-continuous-build-deployment-using-appcenter/</link>
					<comments>https://subodhnpushpak.wordpress.com/2019/07/31/flutter-continuous-build-deployment-using-appcenter/#respond</comments>
		
		<dc:creator><![CDATA[Subodh N Pushpak]]></dc:creator>
		<pubDate>Wed, 31 Jul 2019 14:03:35 +0000</pubDate>
				<category><![CDATA[Flutter]]></category>
		<category><![CDATA[AppCenter]]></category>
		<category><![CDATA[Contineous Deployment]]></category>
		<guid isPermaLink="false">http://subodhnpushpak.wordpress.com/?p=780</guid>

					<description><![CDATA[Flutter is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase. After extensively working on Xamarin; i decided to give flutter a go an was pleasantly surprised by ease-of- development. Though new to Dart; i realized that  the learning curve is extremely flat for someone already well &#8230; <a href="https://subodhnpushpak.wordpress.com/2019/07/31/flutter-continuous-build-deployment-using-appcenter/" class="more-link">Continue reading <span class="screen-reader-text">Flutter continuous build / deployment using&#160;AppCenter</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><a href="https://flutter.dev/" target="_blank">Flutter</a> is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase. After extensively working on <a href="https://docs.microsoft.com/en-us/xamarin/" target="_blank">Xamarin</a>; i decided to give flutter a go an was pleasantly surprised by ease-of- development. Though new to <a href="https://dart.dev/">Dart</a>; i realized that  the learning curve is extremely flat for someone already well aware of C# / Java / Typescript.</p>
<p>One thing i missed was contineuous deployment via <a href="https://appcenter.ms">appcenter.ms</a>. Appcenter (previously known as Hockey app) provides interface to deploy and manage apps. Appcenter has built in support for native iOS Swift / Objective C and Android Java / Kotlin based apps along with Xamarin Forms.</p>
<p>App Center lacks suport for flutter apps for now. So i decided to figure out how to enable flutter app deployment via AppCenter</p>
<p>In this exercise; I will be connecting to Github to get the code from github; compile it and build apk (for android) / or ipa (for iOS)</p>
<p>First; Get flutter SDK, and make an app and run it; or alternately, if you already have an app open .gitignore file present at the base folder of the flutter app.</p>
<p><strong>Remove or comment out gradle-wrapper.jar, gradlew </strong>and<strong> gradlew.bat</strong> from the .gitignore file and add the file to github Appcenter can recognize an app for android build only when it detects these files from the Github code.</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2019/07/gitignorefile.jpg" alt="" width="1070" height="898" /></p>
<p>On appcenter, the custom scripts can be hooked to the build at three stages</p>
<p><strong>Stage 1: Post Clone </strong>with filename <strong>appcenter-post-clone.sh</strong></p>
<p><strong>Stage 2: Pre Build</strong>with filename <strong>appcenter-pre-build.sh</strong></p>
<p><strong>Stage 3: Post Build </strong>with filename <strong>appcenter-post-build.sh</strong></p>
<p>Since we want to get flutter SDK and set it up just after cloning our app code we will harness the <strong>Stage 1: Post Clone </strong>stage. That means we will add a file named <strong>appcenter-post-clone.sh </strong>to <strong>project/android/app</strong></p>
<p>The contents of the file is as (you can also get it from <a href="https://github.com/Microsoft/appcenter-build-scripts-examples/tree/master/flutter" target="_blank">https://github.com/Microsoft/appcenter-build-scripts-examples/tree/master/flutter</a></p>
<table style="height:196px;" width="1236">
<tbody>
<tr>
<td>
<pre style="font-family:'Courier New';font-size:9pt;">#!/usr/bin/env bash
#Place this script in project/android/app/

cd ..

# fail if any command fails
set -e
# debug log
set -x

cd ..
git clone -b master https://github.com/flutter/flutter.git
export PATH=`pwd`/flutter/bin:$PATH

flutter channel stable
flutter doctor

echo "Installed flutter to `pwd`/flutter"

flutter build apk --release

#copy the APK where AppCenter will find it
mkdir -p android/app/build/outputs/apk/; mv build/app/outputs/apk/release/app-release.apk $_</pre>
</td>
</tr>
</tbody>
</table>
<p>After adding the project structure will be like </p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2019/07/projectchanges.jpg" alt="" width="479" height="506" /></p>
<p> </p>
<p>Once the above changes are made add the file to github and commit / push the code.</p>
<p>On the <a href="https://appcenter.ms">appcenter.ms</a>; make a new project by choosing android java kotlin based app and choose github to fetch the code. </p>
<p>Once the above is configured. Choose the build settings. </p>
<p>The settings is the &#8220;settings cog&#8221; which ONLY appears on row hover. </p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2019/07/settings.jpg" alt="" width="1313" height="417" /></p>
<p> </p>
<p>on settings; choose the appropriator settings and click on save and build:</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2019/07/configurebuild-1.jpg" alt="" width="839" height="889" /></p>
<p> </p>
<p>Once the build has started the script will fetch flutter and compile the app and produce apk which can be distributed.</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2019/07/succesful-build.jpg" alt="" /></p>
<p> </p>
<p>Thus we can build an flutter app on appcenter..</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://subodhnpushpak.wordpress.com/2019/07/31/flutter-continuous-build-deployment-using-appcenter/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/ca4dffc06c2219965b6c16d8705646c48cfbbec0bd22d82033a3b4cd4ed6f404?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">subodhnpushpak</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2019/07/gitignorefile.jpg" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2019/07/projectchanges.jpg" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2019/07/settings.jpg" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2019/07/configurebuild-1.jpg" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2019/07/succesful-build.jpg" medium="image" />
	</item>
		<item>
		<title>Search within Word, Excel and Office Documents using Azure Search</title>
		<link>https://subodhnpushpak.wordpress.com/2017/10/03/search-within-word-excel-and-office-documents-using-azure-search/</link>
					<comments>https://subodhnpushpak.wordpress.com/2017/10/03/search-within-word-excel-and-office-documents-using-azure-search/#respond</comments>
		
		<dc:creator><![CDATA[Subodh N Pushpak]]></dc:creator>
		<pubDate>Tue, 03 Oct 2017 09:27:56 +0000</pubDate>
				<category><![CDATA[Metro Apps, Win8, ASP .NET Web API, iOS, iPAd]]></category>
		<guid isPermaLink="false">http://subodhnpushpak.wordpress.com/?p=582</guid>

					<description><![CDATA[Azure cognitive services provide various feature like language translation and search. This blog delves deeper on how to set up azure to search contents within various data sources like Office documents like word, excel, powerpoint which are on Azure blog.  Besides some configuration on Azure portal; Search involoves generating indexes first which is a three step &#8230; <a href="https://subodhnpushpak.wordpress.com/2017/10/03/search-within-word-excel-and-office-documents-using-azure-search/" class="more-link">Continue reading <span class="screen-reader-text">Search within Word, Excel and Office Documents using Azure&#160;Search</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><img data-attachment-id="673" data-permalink="https://subodhnpushpak.wordpress.com/2017/10/03/search-within-word-excel-and-office-documents-using-azure-search/img1/" data-orig-file="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/img11.jpg" data-orig-size="1920,1308" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="img1" data-image-description="" data-image-caption="" data-medium-file="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/img11.jpg?w=300" data-large-file="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/img11.jpg?w=1024" class="alignnone size-full wp-image-673" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/img11.jpg" alt="img1" width="1920" height="1308" srcset="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/img11.jpg 1920w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/img11.jpg?w=150&amp;h=102 150w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/img11.jpg?w=300&amp;h=204 300w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/img11.jpg?w=768&amp;h=523 768w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/img11.jpg?w=1024&amp;h=698 1024w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/img11.jpg?w=1440&amp;h=981 1440w" sizes="(max-width: 1920px) 100vw, 1920px" /></p>
<p>Azure <a href="https://azure.microsoft.com/en-in/services/cognitive-services/" target="_blank" rel="noopener">cognitive services</a> provide various feature like <a href="https://subodhnpushpak.wordpress.com/2016/10/28/text-translation-migrating-from-microsoft-datamarket-to-azure-cognitive-services/" target="_blank" rel="noopener">language translation</a> and search. This blog delves deeper on how to set up azure to search contents within various data sources like Office documents like word, excel, powerpoint which are on Azure blog. <span id="more-582"></span><!--more--></p>
<p>Besides some configuration on Azure portal; Search involoves generating indexes first which is a three step process</p>
<ol>
<li>Identifying the blob data source container to search and setting it up. This defines WHERE to search</li>
<li>Defining the Index. This defines WHAT to search. This include setting up &#8220;fields&#8221; to search and its properties</li>
<li>Defining the Indexer. This defines HOW the search is set up or its configurations. This has feature set up like which file extensions whic must be ignored while saerching like image files (.png, ,jpg). It also defines indexing scehdule.</li>
</ol>
<p>The above can be done by using REST based API calls including using tools like Postman or in SDKs available in various programming languages which includes .Net via Nuget packages <a href="https://www.nuget.org/packages/Microsoft.Azure.Search/3.0.4" target="_blank" rel="noopener">Microsoft.Azure.Search</a> and <a href="https://www.nuget.org/packages/Microsoft.Azure.Management.Search/" target="_blank" rel="noopener">Microsoft.Azure.Management.Search</a></p>
<p>So lets start by setting up <a href="https://portal.azure.com/" target="_blank" rel="noopener">Azure Portal</a></p>
<ol>
<li> Log in portal and create a new search service. Please note that the name you use will be used as unique url while calling REST APIs. Choose your subscription, location and Pricing Tier<img data-attachment-id="639" data-permalink="https://subodhnpushpak.wordpress.com/2017/10/03/search-within-word-excel-and-office-documents-using-azure-search/attachment/1/" data-orig-file="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/12.png" data-orig-size="840,620" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="1" data-image-description="" data-image-caption="" data-medium-file="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/12.png?w=300" data-large-file="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/12.png?w=840" class="alignnone size-full wp-image-639" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/12.png" alt="1" width="840" height="620" srcset="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/12.png 840w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/12.png?w=150&amp;h=111 150w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/12.png?w=300&amp;h=221 300w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/12.png?w=768&amp;h=567 768w" sizes="(max-width: 840px) 100vw, 840px" /></li>
<li>After the service is created; navigate to keys and copy the Primary admin key. This key is the identification for all the incoming API calls to this search service.<img loading="lazy" data-attachment-id="632" data-permalink="https://subodhnpushpak.wordpress.com/2017/10/03/search-within-word-excel-and-office-documents-using-azure-search/attachment/2/" data-orig-file="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/2.png" data-orig-size="1897,810" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="2" data-image-description="" data-image-caption="" data-medium-file="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/2.png?w=300" data-large-file="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/2.png?w=1024" class="alignnone size-full wp-image-632" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/2.png" alt="2" width="1897" height="810" srcset="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/2.png 1897w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/2.png?w=150&amp;h=64 150w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/2.png?w=300&amp;h=128 300w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/2.png?w=768&amp;h=328 768w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/2.png?w=1024&amp;h=437 1024w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/2.png?w=1440&amp;h=615 1440w" sizes="(max-width: 1897px) 100vw, 1897px" /></li>
<li>After the above configuration; lets move on to create search indexes; which as mentioned above is a three step process:</li>
</ol>
<p>Assuming the service name is blsearchpoc. All the url will be blsearchpoc. If you have named service as aomething else; go ahead and change url accordingly.</p>
<h2><strong>Identifying the blob data source container to search and setting it up</strong></h2>
<p>This defines WHERE to search</p>
<p>First calling via <a href="https://www.getpostman.com/postman" target="_blank" rel="noopener">postman</a>: (Don&#8217;t forget to replace the <em><strong>placehoders</strong> </em>with your own setup)</p>
<p style="padding-left:30px;">url: https://blsearchpoc.search.windows.net/datasources?api-version=2016-09-01</p>
<p style="padding-left:30px;">headers:</p>
<blockquote>
<p style="padding-left:30px;">api-key :&#8221;<em><strong>Primary_admin_key_COPIED_FROM_AZURE_PORTAL</strong></em>&#8221;<br />
Content-Type: &#8220;application/json&#8221;</p>
</blockquote>
<p style="padding-left:30px;"><strong>Body</strong>:</p>
<pre style="padding-left:30px;">{
 "name" : "blob-datasource",
 "type" : "azureblob",
 "credentials" : { "connectionString" : "DefaultEndpointsProtocol=https;AccountName=<em><strong>BLOB_ACCOUNT_NAME</strong></em>;AccountKey=<em><strong>BLOB_ACCOUNT_KEY</strong></em>;" },
 "container" : { "name" : "<strong><em>container</em>-name</strong>", "query" : "<em><strong>directory_name_within_container</strong></em>" }
}</pre>
<p>in C#</p>
<p>create a search client</p>
<blockquote><p>private SearchServiceClient CreateSearchServiceClient()<br />
{<br />
string searchServiceName = &#8220;YOUR SERVICE NAME&#8221;;<br />
string adminApiKey = &#8220;API KEY&#8221;;<br />
SearchServiceClient serviceClient = new SearchServiceClient(searchServiceName, new SearchCredentials(adminApiKey));<br />
return serviceClient;<br />
}</p>
<p>// 1. Define the blob data source</p>
<p>string dataSourceName = string.Format(&#8220;blobdatasource-{0}&#8221;, folderName.Replace(&#8220;/&#8221;, &#8220;&#8221;));</p>
<p>string connectionString = ConfigurationManager.AppSettings[&#8220;StorageConnectionString&#8221;];</p>
<p>if (string.IsNullOrEmpty(connectionString))</p>
<p>{</p>
<p>throw new Exception(&#8220;No connection string for storage!! Contact admin&#8221;);</p>
<p>}</p>
<p>DataSourceCredentials cred = new DataSourceCredentials(connectionString);</p>
<p>DataContainer datacontainer = new DataContainer(containerName, folderName);</p>
<p>DataSource dataSource = new DataSource(dataSourceName, DataSourceType.AzureBlob, cred, datacontainer);</p></blockquote>
<h2>Defining the Index</h2>
<p>This defines WHAT to search. This include setting up &#8220;fields&#8221; to search and its properties. You may set the fields of the index, their datatype, wheather each fiels is sortble and unique or not, etc. These fields are useful while retrieving search results back.</p>
<p>url: https://blsearchpoc.search.windows.net/datasources?api-version=2016-09-01</p>
<p>headers:</p>
<pre>api-key :"<em><strong>Primary_admin_key_COPIED_FROM_AZURE_PORTAL</strong></em>"
Content-Type: "application/json"</pre>
<p><strong>Body</strong>:</p>
<pre>{
 "name" : "my-target-index",
 "fields": [
 { "name": "id", "type": "Edm.String", "key": true, "searchable": false },
 { "name": "content", "type": "Edm.String", "searchable": true, "filterable": false, "sortable": false, "facetable": false }
 ]
}</pre>
<p>the above in C# with some extra fields setup:</p>
<blockquote><p>// 2. Define the index<br />
indexName = &#8220;my-target-index&#8221;;<br />
Index index = new Index(indexName, new List() { new Field() { Name= &#8220;id&#8221;, Type=DataType.String, IsKey=true, IsSearchable=false } ,<br />
new Field() { Name=&#8221;content&#8221;, Type=DataType.String, IsSearchable=true, IsFilterable=false, IsSortable=true, IsFacetable=false},<br />
new Field() { Name=&#8221;uniquefilename&#8221;, Type=DataType.String, IsSearchable=true, IsFilterable=false, IsSortable=true, IsFacetable=false},<br />
new Field() { Name=&#8221;filedisplayname&#8221;, Type=DataType.String, IsSearchable=true, IsFilterable=false, IsSortable=true, IsFacetable=false},<br />
new Field() { Name=&#8221;uniquefileId&#8221;, Type=DataType.String, IsSearchable=true, IsFilterable=false, IsSortable=true, IsFacetable=false},<br />
new Field() { Name=&#8221;filename&#8221;, Type=DataType.String, IsSearchable=true, IsFilterable=false, IsSortable=true, IsFacetable=false} });<br />
serviceClient.Indexes.CreateOrUpdate(index);</p></blockquote>
<h2>Defining the Indexer</h2>
<p>This defines HOW the search is set up. The indexers defines how often the content is indexed; what file type are ignored for indexing and most importantly it maps datasource and indexname created in steps 1 &amp; 2 above.</p>
<p>url: https://blsearchpoc.search.windows.net/indexers?api-version=2016-09-01</p>
<p>headers:</p>
<pre>api-key :"<em><strong>Primary_admin_key_COPIED_FROM_AZURE_PORTAL</strong></em>"
Content-Type: "application/json"</pre>
<p><strong>Body</strong>:</p>
<pre>{
 "name" : "my-blob-indexer",
 "dataSourceName" : "blob-datasource",
 "targetIndexName" : "my-target-index",
 "schedule" : { "interval" : "PT5M" }
}</pre>
<p>If the index have some custom field names then mapping must be done to ensure indexer knows how to fetch these values from the blob.</p>
<p>The below code is assuming that each of the blob file have meta_data associated with it which is mapped to fieldname.</p>
<blockquote><p>// 3. Define the indexer, its schedule with datasource and index<br />
IndexingSchedule schedule = new IndexingSchedule(TimeSpan.FromMinutes(5.0));<br />
IndexingParameters parameters = new IndexingParameters();<br />
parameters.ExcludeFileNameExtensions(new string[] { &#8220;.png,.jpeg,.jpg,.bmp,.gif,.mp3&#8221; });<br />
parameters.DoNotFailOnUnsupportedContentType();<br />
string indexerName = string.Format(&#8220;indexer-{0}&#8221;, folderName.Replace(&#8220;/&#8221;, &#8220;&#8221;));<br />
List fieldMappings = new List();<br />
{<br />
FieldMapping fieldMapping = new FieldMapping(sourceFieldName: &#8220;metadata_uniquefilename&#8221;, targetFieldName: &#8220;uniquefilename&#8221;);<br />
fieldMappings.Add(fieldMapping);<br />
}<br />
{<br />
FieldMapping fieldMapping = new FieldMapping(sourceFieldName: &#8220;metadata_filedisplayname&#8221;, targetFieldName: &#8220;filedisplayname&#8221;);<br />
fieldMappings.Add(fieldMapping);<br />
}<br />
{<br />
FieldMapping fieldMapping = new FieldMapping(sourceFieldName: &#8220;metadata_storage_name&#8221;, targetFieldName: &#8220;filename&#8221;);<br />
fieldMappings.Add(fieldMapping);<br />
}<br />
Indexer indexer = new Indexer(indexerName, dataSourceName, indexName, schedule: schedule, parameters: parameters, fieldMappings: fieldMappings);<br />
serviceClient.Indexers.CreateOrUpdate(indexer);</p>
<p>// adding metadata while adding blob</p>
<p>private static void AddBlobMetadata(CloudBlockBlob blockBlob, string fileDisplayName, string uniqueFileId, Boolean IsDeleted)<br />
{<br />
//Add some metadata<br />
blockBlob.Metadata[&#8220;filedisplayname&#8221;] = fileDisplayName;<br />
blockBlob.Metadata[&#8220;uniquefileId&#8221;] = uniqueFileId;<br />
blockBlob.Metadata[&#8220;isDeleted&#8221;] = IsDeleted.ToString();</p>
<p>//Set the container&#8217;s metadata.<br />
blockBlob.SetMetadata();<br />
}</p></blockquote>
<p>You can see all the Datastorage, indexes and indexers on the azure site by navigating to the search service &#8211;&gt; Overview.</p>
<p><img loading="lazy" data-attachment-id="734" data-permalink="https://subodhnpushpak.wordpress.com/2017/10/03/search-within-word-excel-and-office-documents-using-azure-search/attachment/3/" data-orig-file="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/3.png" data-orig-size="1883,913" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="3" data-image-description="" data-image-caption="" data-medium-file="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/3.png?w=300" data-large-file="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/3.png?w=1024" class="alignnone size-full wp-image-734" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/3.png" alt="3" width="1883" height="913" srcset="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/3.png 1883w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/3.png?w=150&amp;h=73 150w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/3.png?w=300&amp;h=145 300w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/3.png?w=768&amp;h=372 768w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/3.png?w=1024&amp;h=497 1024w, https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/3.png?w=1440&amp;h=698 1440w" sizes="(max-width: 1883px) 100vw, 1883px" /></p>
<p>You can use azure portal to search within docs as well by using &#8220;search options&#8221;</p>
<p>Since &#8220;search&#8221; call is GET; you can easily all it using postman: Remeber to search</p>
<blockquote><p>https://<em><strong>blsearchpoc.</strong></em>search.windows.net/indexes/my-target-index/docs?api-version=2016-09-01&amp;search=ANY_SEARCH_TERM_TO_BE_USED</p></blockquote>
<p>In C#:</p>
<blockquote><p>public dynamic Search(string indexToSearch, string searchTerm)<br />
{<br />
dynamic searchResult = new ExpandoObject();</p>
<p>SearchServiceClient serviceClient = CreateSearchServiceClient();// searchServiceName, adminApiKey);<br />
string indexName = indexToSearch;</p>
<p>ISearchIndexClient indexClient = serviceClient.Indexes.GetClient(indexName);<br />
var results = indexClient.Documents.Search(searchTerm);<br />
//Console.WriteLine(&#8220;Search result count: {0}&#8221;, results.Results.Count);<br />
searchResult.SearchResultCount = results.Results.Count;<br />
List searchResultItems = new List();<br />
foreach (var result in results.Results)<br />
{<br />
dynamic searchResultItem = new ExpandoObject();<br />
// Console.WriteLine(&#8220;{0}, {1}, {2}&#8221;, result.Document, result.Highlights, result.Score);<br />
if (result.Document.ContainsKey(&#8220;content&#8221;))<br />
{<br />
//Console.WriteLine(&#8220;Content: {0}&#8221;, result.Document[&#8220;content&#8221;]);<br />
searchResultItem.Content = result.Document[&#8220;content&#8221;];<br />
}<br />
if (result.Document.ContainsKey(&#8220;filename&#8221;))<br />
{<br />
//Console.WriteLine(&#8220;Content: {0}&#8221;, result.Document[&#8220;content&#8221;]);<br />
searchResultItem.FileName = result.Document[&#8220;filename&#8221;];<br />
}<br />
if (result.Document.ContainsKey(&#8220;uniquefilename&#8221;))<br />
{<br />
//Console.WriteLine(&#8220;Content: {0}&#8221;, result.Document[&#8220;content&#8221;]);<br />
searchResultItem.Uniquefilename = result.Document[&#8220;uniquefilename&#8221;];<br />
}<br />
if (result.Document.ContainsKey(&#8220;uniquefileId&#8221;))<br />
{<br />
//Console.WriteLine(&#8220;Content: {0}&#8221;, result.Document[&#8220;content&#8221;]);<br />
searchResultItem.Uniquefilename = result.Document[&#8220;uniquefileId&#8221;];<br />
}<br />
searchResultItems.Add(searchResultItem);<br />
}<br />
searchResult.SearchResultItems = searchResultItems;<br />
return searchResult;<br />
}</p></blockquote>
<p>Azure uses Lucene indexing behind the scenes. We can even levarage Lucene indexes out of the box if Azure search is not required out of the box.. More on it in next blog&#8230;</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://subodhnpushpak.wordpress.com/2017/10/03/search-within-word-excel-and-office-documents-using-azure-search/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/ca4dffc06c2219965b6c16d8705646c48cfbbec0bd22d82033a3b4cd4ed6f404?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">subodhnpushpak</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/img11.jpg" medium="image">
			<media:title type="html">img1</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/12.png" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/2.png" medium="image">
			<media:title type="html">2</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/09/3.png" medium="image">
			<media:title type="html">3</media:title>
		</media:content>
	</item>
		<item>
		<title>Five reasons why you need an Mobile app for YOUR business</title>
		<link>https://subodhnpushpak.wordpress.com/2017/08/29/five-reasons-why-you-need-an-mobile-app-for-your-business/</link>
					<comments>https://subodhnpushpak.wordpress.com/2017/08/29/five-reasons-why-you-need-an-mobile-app-for-your-business/#respond</comments>
		
		<dc:creator><![CDATA[Subodh N Pushpak]]></dc:creator>
		<pubDate>Tue, 29 Aug 2017 11:58:22 +0000</pubDate>
				<category><![CDATA[Bluelupin]]></category>
		<category><![CDATA[MobileKonnect]]></category>
		<category><![CDATA[Architecture]]></category>
		<guid isPermaLink="false">http://subodhnpushpak.wordpress.com/?p=579</guid>

					<description><![CDATA[    My business is a small business; who will use my app? Think about it. You are small because you are not leveraging the technologies and tools at hand. Big business are big because they are using technology to their benefit. Unless you create a brand value; you understand where your businesses is heading &#8230; <a href="https://subodhnpushpak.wordpress.com/2017/08/29/five-reasons-why-you-need-an-mobile-app-for-your-business/" class="more-link">Continue reading <span class="screen-reader-text">Five reasons why you need an Mobile app for YOUR&#160;business</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p><span style="color:#000080;"><img style="vertical-align:baseline;" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/08/11.jpg" alt="small business" width="1039" height="398" />   </span></p>
<p><span style="color:#000080;">My business is a small business; who will use my app?</span></p>
<p>Think about it. You are small because you are not leveraging the technologies and tools at hand. Big business are big because they are using technology to their benefit.</p>
<p>Unless you <em><strong>create a brand value</strong></em>; you <em><strong>understand</strong> </em>where your businesses is heading with stats supporting it; you might not be able to make it big. In today&#8217;s world; you don&#8217;t get big and then invest in tech; its rather other way round; <em><strong>you invest in tech to get big</strong></em>.</p>
<p>Think about that. Again.</p>
<p><span style="color:#000080;">I have a website with SEO? That suffices my need.</span></p>
<p>While having a website is a good start; it might not be enough for the tech savvy customers. A mobile app has key competitive advantage like unmatched user engagements, location awareness and above all user retention and it speaks volumes about your business and <em><strong>brand loyalty</strong></em>. Most successful businesses have a great website and <em><strong>an awesome native app</strong></em>.</p>
<p><span style="color:#333333;"><span style="color:#000080;">Do you remember</span><span style="color:#000080;"> the links you opened on browser, yesterday?</span></span><span style="color:#000000;"><span style="color:#000080;"> </span></span></p>
<p>Hard to remember? OK. after that question; now contrast the situation to below one: </p>
<p>Do you even have to think twice before using an app you installed few days back? and with the awesome features it had. Now think that your business had an app and the possibilities which comes along with it. Trust me; you will provide your business a <em><strong>NEW DIMENSION with native mobile app</strong></em>.</p>
<p><span style="color:#003366;">My business is already</span><span style="color:#000080;"> on aggregater which opens my business to millions of users.</span></p>
<p>This one is tricky. You may get the sales; but are you really counting your customers? Confused? read on&#8230;</p>
<p><span style="color:#003300;">No user retention</span></p>
<p>If you are a supplier and are getting business from content aggregates or e-business platforms; do remember that while these platforms may be good for discovery and reach-ability these aggregaters provide for; they may not establish you as a <em><strong>key player in the market</strong></em> because the brand value is missing.</p>
<p>Ask someone from where you have bought that cool gadget; and the answer will be an e-commerce platform. Ask the seller name and 95% of the buyers have no clue. You might have best product; you might work tirelessly to work up the the ladder among all the sellers which might be trying as hard as you are. You make a SALE. But the buyer is pleased with the e-commerce aggregater!!! You have created almost no impression for repeat business!!!</p>
<p>OK, you might get some stats about &#8220;buyer behavior&#8221; but so do your all competitor sellers on the platform. That levels out any advantages, if there are any!!!</p>
<p><span style="color:#003366;">What about YOUR Business USPs?</span></p>
<p>Every business has an USP; an aggregater offers standard features for every business. Where do you put those exciting features you always thought of which makes you stand apart from crowd?</p>
<p><span style="color:#003366;">Mobile apps need tech expertise; its complex, time consuming and involves lot of money.</span></p>
<p>The answer to above is YES. App development requires tech people of diverse capabilities like server side, ios / android specific platforms which keeps on eveloving every six months. But the answer is simple; </p>
<p><a href="https://www.bluelupin.com/mobilekonnect/" target="_blank">Get an app for YOUR business for YOUR Brand from state-of-art CMS based platform offered by Bluelupin &#8211; MobileKonnect. </a></p>
<p>Among other features it <em><span style="text-decoration:underline;"><strong>provides you an app with YOUR logo and YOUR branding</strong></span></em>. <span style="text-decoration:underline;"><strong>All with in hours. All with in budget of a website</strong></span>. </p>
<p>Folks at MobileKonnect are super cool and they can shell out custom featured app with in hours.</p>
<p>The <em><strong>artificial intelligent powered analytics</strong></em> will provide you insights into user behaviors and patterns you never imagined before.</p>
<p>Do not think anymore; what do you have to loose??</p>
<p><a href="https://www.bluelupin.com/lets-talk/" target="_blank"><strong> Take that step ahead. Call or email now and i promise you this is one decision you will ever cherish</strong></a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://subodhnpushpak.wordpress.com/2017/08/29/five-reasons-why-you-need-an-mobile-app-for-your-business/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/ca4dffc06c2219965b6c16d8705646c48cfbbec0bd22d82033a3b4cd4ed6f404?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">subodhnpushpak</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2017/08/11.jpg" medium="image">
			<media:title type="html">small business</media:title>
		</media:content>
	</item>
		<item>
		<title>VS2017 on Mac!!</title>
		<link>https://subodhnpushpak.wordpress.com/2016/12/09/vs2017-on-mac/</link>
					<comments>https://subodhnpushpak.wordpress.com/2016/12/09/vs2017-on-mac/#respond</comments>
		
		<dc:creator><![CDATA[Subodh N Pushpak]]></dc:creator>
		<pubDate>Fri, 09 Dec 2016 08:46:15 +0000</pubDate>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[NETCore]]></category>
		<category><![CDATA[VS2017]]></category>
		<guid isPermaLink="false">http://subodhnpushpak.wordpress.com/?p=575</guid>

					<description><![CDATA[Tried VS2017 on Mac. I am well versed with super-awesome Xamarin Studio on Mac and work extensively on VS2015. I am aware that VS2017 is built out of Xamarin studio; but the VS2017 editor is very stable and &#8220;feels at home&#8221;.  You may install the installer from https://www.visualstudio.com/vs/visual-studio-mac/ VS2017 is a fully featured IDE and not &#8230; <a href="https://subodhnpushpak.wordpress.com/2016/12/09/vs2017-on-mac/" class="more-link">Continue reading <span class="screen-reader-text">VS2017 on Mac!!</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Tried VS2017 on Mac. I am well versed with super-awesome Xamarin Studio on Mac and work extensively on VS2015. I am aware that VS2017 is built out of Xamarin studio; but the VS2017 editor is very stable and &#8220;feels at home&#8221;. </p>
<p>You may install the installer from <a href="https://www.visualstudio.com/vs/visual-studio-mac/">https://www.visualstudio.com/vs/visual-studio-mac/</a></p>
<p>VS2017 is a fully featured IDE and not to be confused with Visual Studio Code; which is more of a quick; light weight code editor.  </p>
<p><a href="https://code.visualstudio.com/d?utm_expid=101350005-35.Eg8306GUR6SersZwpBjURQ.3&amp;utm_referrer=https%3A%2F%2Fwww.google.co.in%2F">https://code.visualstudio.com/d?utm_expid=101350005-35.Eg8306GUR6SersZwpBjURQ.3&amp;utm_referrer=https%3A%2F%2Fwww.google.co.in%2F</a></p>
<p>For building a quick; .net core application;</p>
<p>select the template and go&#8230;</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/12/screen-shot-2016-12-09-at-2-00-35-pm.png" alt="selecttemplate" width="902" height="654" /></p>
<p>it will take some time to initiate the boiler-plate code and fetch all dependancies..</p>
<p>If .Net core is not install; it will ask to install Homebrew for openssl along with .net core installation</p>
<p>Homebrew installation is here</p>
<p><a href="https://github.com/Homebrew/brew/blob/master/docs/Installation.md#installation">https://github.com/Homebrew/brew/blob/master/docs/Installation.md#installation</a></p>
<p>The formula for OpenSSL is @ <a href="http://brewformulas.org/Openssl">http://brewformulas.org/Openssl</a></p>
<p>At mac terminal paste to below command for Homebrew</p>
<p class="p1"><span class="s1">r<strong>uby -e &#8220;$(curl -fsSL <a href="https://raw.githubusercontent.com/Homebrew/install/master/install)&quot;">https://raw.githubusercontent.com/Homebrew/install/master/install)&#8221;</a></strong></span></p>
<p class="p1"> </p>
<p class="p1"><span class="s1"></span></p>
<p class="p1"><strong><span class="s1">brew install openssl</span></strong></p>
<p class="p1"> </p>
<p class="p1"><span class="s1"> or for updating OpenSSL </span></p>
<p class="p1"> </p>
<p class="p1"><strong><span>brew link &#8211;force openssl</span></strong></p>
<p class="p1"> </p>
<p class="p1"><span>if struck; find more information here</span></p>
<p class="p1"><span><a href="https://github.com/dotnet/coreclr/blob/63766f74c4a641a274cd2933b9b7fd7bbddef2dd/Documentation/building/osx-instructions.md#openssl">https://github.com/dotnet/coreclr/blob/63766f74c4a641a274cd2933b9b7fd7bbddef2dd/Documentation/building/osx-instructions.md#openssl</a></span></p>
<p class="p1"> </p>
<p class="p1"><span>You may be required to update Nuget packages when running for the first time</span></p>
<p class="p1"> </p>
<p>&lt;</p>
<p>p class=&#8221;p1&#8243;&gt;<span><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/12/screen-shot-2016-12-09-at-2-04-19-pm.png" alt="" width="1278" height="705" /></span></p>
<p>VS2017 debugging features are as awesome as it gets..</p>
<p>.Net core is proving to be a great alternative to enterprise level NodeJs; Now with the great tooling supports it might be a better one!!</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://subodhnpushpak.wordpress.com/2016/12/09/vs2017-on-mac/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/ca4dffc06c2219965b6c16d8705646c48cfbbec0bd22d82033a3b4cd4ed6f404?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">subodhnpushpak</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/12/screen-shot-2016-12-09-at-2-00-35-pm.png" medium="image">
			<media:title type="html">selecttemplate</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/12/screen-shot-2016-12-09-at-2-04-19-pm.png" medium="image" />
	</item>
		<item>
		<title>Text Translation: Migrating from Microsoft Datamarket to Azure Cognitive Services</title>
		<link>https://subodhnpushpak.wordpress.com/2016/10/28/text-translation-migrating-from-microsoft-datamarket-to-azure-cognitive-services/</link>
					<comments>https://subodhnpushpak.wordpress.com/2016/10/28/text-translation-migrating-from-microsoft-datamarket-to-azure-cognitive-services/#comments</comments>
		
		<dc:creator><![CDATA[Subodh N Pushpak]]></dc:creator>
		<pubDate>Fri, 28 Oct 2016 09:32:04 +0000</pubDate>
				<category><![CDATA[Translation]]></category>
		<category><![CDATA[Azure]]></category>
		<guid isPermaLink="false">http://subodhnpushpak.wordpress.com/?p=559</guid>

					<description><![CDATA[Microsoft translation APIs moved from Microsoft DataMarket to Microsoft Azure Portal. Here is the announcements on the same. Microsoft Translator Text and Speech Translation APIs are now available in the Azure portal under the Cognitive Services category. Existing applications using Microsoft Translator need to be changed before April 30, 2017. Cognitive Services are new home &#8230; <a href="https://subodhnpushpak.wordpress.com/2016/10/28/text-translation-migrating-from-microsoft-datamarket-to-azure-cognitive-services/" class="more-link">Continue reading <span class="screen-reader-text">Text Translation: Migrating from Microsoft Datamarket to Azure Cognitive&#160;Services</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Microsoft translation APIs moved from <a href="https://datamarket.azure.com/home">Microsoft DataMarket</a> to <a href="https://portal.azure.com">Microsoft Azure Portal</a>. Here is the <a href="https://translatorbusiness.uservoice.com/knowledgebase/articles/1078534-microsoft-translator-on-azure?WT.mc_id=azurebg_email_Trans_1228_Microsoft_Translator_Azure_Portal">announcements</a> on the same.</p>
<p>Microsoft Translator Text and Speech Translation APIs are now available in the <a href="https://click.email.microsoftemail.com/?qs=be174ad21b0b9fb327d6cccae692bdff1b00245fe3e78f62cea72b2944f2056353ba7690bb0db9ac">Azure portal</a> under the <a href="https://www.microsoft.com/cognitive-services/">Cognitive Services</a> category. Existing applications using Microsoft Translator need to be changed before April 30, 2017.</p>
<p><a href="https://www.microsoft.com/cognitive-services/">Cognitive Services</a> are new home for translation APIs. Here is a snapshot</p>
<p>&nbsp;</p>
<p><a href="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image.png"><img style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border:0;" title="image" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb.png" alt="image" width="757" height="371" border="0" /></a></p>
<p>&nbsp;</p>
<p>For getting started-up on new Azure Translation APIs please follow steps on: <a title="https://www.microsoft.com/en-us/translator/getstarted.aspx" href="https://www.microsoft.com/en-us/translator/getstarted.aspx">https://www.microsoft.com/en-us/translator/getstarted.aspx</a></p>
<p>Here is step by step procedure by <b></b><b>Adding Microsoft Translator subscription to your Azure account</b></p>
<ol>
<li>Log into <a title="https://portal.azure.com" href="https://portal.azure.com">https://portal.azure.com</a> and select Cognitive Services:</li>
</ol>
<p>Select “+” and search for “Cognitive Search APIs”. Fill in all the fields</p>
<p><a href="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image1.png"><img style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border:0;" title="image" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb1.png" alt="image" width="299" height="485" border="0" /></a> &#8212; &gt;   <a href="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image2.png"><img style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border:0;" title="image" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb2.png" alt="image" width="256" height="492" border="0" /></a> &#8212;&gt; <a href="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image3.png"><img style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border:0;" title="image" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb3.png" alt="image" width="702" height="490" border="0" /></a> &#8211;&gt;<a href="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image4.png"><img style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border:0;" title="image" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb4.png" alt="image" width="624" height="476" border="0" /></a></p>
<p>&nbsp;</p>
<p>Voila!! you have just created an account for calling Translation APIs RESTfully.</p>
<p>The account you just created will now look like below snapshot. We are interested in <strong>Keys </strong>section. Select keys and copy Key1 as below: <strong>This key will be used as Subscription-Key or Ocp-Apim-Subscription-Key</strong></p>
<p><a href="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image5.png"><img style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border:0;" title="image" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb5.png" alt="image" width="593" height="561" border="0" /></a> &#8212;&#8212;-&gt; <a href="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image6.png"><img style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border:0;" title="image" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb6.png" alt="image" width="409" height="579" border="0" /></a></p>
<p>Now the fun part: Lets do some translations using <a href="https://www.getpostman.com/">Postman</a>: You can always get token id from page: <a title="http://docs.microsofttranslator.com/oauth-token.html" href="http://docs.microsofttranslator.com/oauth-token.html">http://docs.microsofttranslator.com/oauth-token.html</a></p>
<p>First; lets fetch</p>
<p>DataMarket api WAS:</p>
<p>url: <a title="https://datamarket.accesscontrol.windows.net/v2/OAuth2-13" href="https://datamarket.accesscontrol.windows.net/v2/OAuth2-13">https://datamarket.accesscontrol.windows.net/v2/OAuth2-13</a></p>
<p>Content-Type: application/x-www-form-urlencoded</p>
<p>payload: grant_type=client_credentials&amp;client_id=&lt;clientID&gt;&amp;client_secret=&lt;clientsecret&gt;&amp;scope=http://api.microsofttranslator.com</p>
<p><a href="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image7.png"><img style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border:0;" title="image" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb7.png" alt="image" width="814" height="510" border="0" /></a></p>
<p>The NEW way to fetch access token using Azure cognitive APIs is</p>
<p>Action: POST</p>
<p>url: <a title="https://api.cognitive.microsoft.com/sts/v1.0/issueToken?Subscription-Key=ad952e48b2374c30be18600343970c55" href="https://api.cognitive.microsoft.com/sts/v1.0/issueToken?Subscription-Key=&lt;subscription-key&gt;">https://api.cognitive.microsoft.com/sts/v1.0/issueToken?Subscription-Key=&lt;subscription-key&gt;</a></p>
<p>Content-Type: application/xml</p>
<p>Ocp-Apim-Subscription-Key : &lt;subscription-key&gt;</p>
<p>payload: &lt;null&gt;</p>
<p>PS: You can either send subscription-key in url OR send it as Ocp-Apim-Subscription-Key in header.</p>
<p><a href="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image8.png"><img style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border:0;" title="image" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb8.png" alt="image" width="816" height="478" border="0" /></a></p>
<p>Now lets translate some text:</p>
<p>Action: POST</p>
<p>url: <a title="http://api.microsofttranslator.com/v2/Http.svc/TranslateArray" href="http://api.microsofttranslator.com/v2/Http.svc/TranslateArray">http://api.microsofttranslator.com/v2/Http.svc/TranslateArray</a></p>
<p>Headers: Authorization Bearer &lt;Key returned from issueToken API&gt;</p>
<p>Content-Type: application/xml</p>
<p>Payload:</p>
<p><a href="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image9.png"><img style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border:0;" title="image" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb9.png" alt="image" width="1442" height="466" border="0" /></a></p>
<p>output:</p>
<p><a href="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image10.png"><img style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border:0;" title="image" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb10.png" alt="image" width="1450" height="588" border="0" /></a></p>
<blockquote><p>Here is some C# code for the same:</p></blockquote>
<blockquote><p>public static async Task&lt;String&gt; GetToken()<br />
{</p>
<p>string clientID = ConfigurationManager.AppSettings[&#8220;ClientID&#8221;].ToString();<br />
string clientSecret =  ConfigurationManager.AppSettings[&#8220;ClientSecret&#8221;].ToString();<br />
Uri translatorAccessURI = new Uri(&#8220;<a href="https://api.cognitive.microsoft.com/sts/v1.0/issueToken?Subscription-Key=">https://api.cognitive.microsoft.com/sts/v1.0/issueToken?Subscription-Key=</a>&lt;YOUR SUBSCRIPTION KEY&gt;&#8221;);//new Uri(&#8220;<a href="https://datamarket.accesscontrol.windows.net/v2/OAuth2-13&quot;);">https://datamarket.accesscontrol.windows.net/v2/OAuth2-13&#8243;);</a></p>
<p>//// Create form parameters that we will send to data market.<br />
//Dictionary&lt;string, string&gt; requestDetails = new Dictionary&lt;string, string&gt;<br />
//    {<br />
//        { &#8220;grant_type&#8221;, &#8220;client_credentials&#8221; },<br />
//        { &#8220;client_id&#8221;,   clientID},<br />
//        { &#8220;client_secret&#8221;,  clientSecret },<br />
//        { &#8220;scope&#8221;, &#8220;<a href="http://api.microsofttranslator.com&quot;/">http://api.microsofttranslator.com&#8221;/</a> }<br />
//    };</p>
<p>//FormUrlEncodedContent requestContent = new FormUrlEncodedContent(requestDetails, Encoding.UTF8, &#8220;application/xml&#8221;);<br />
HttpContent requestContent = new StringContent(&#8220;&#8221;, Encoding.UTF8, &#8220;application/xml&#8221;);<br />
requestContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue(&#8220;application/xml&#8221;);<br />
//Ocp-Apim-Subscription-Key</p>
<p>// We use a HttpClient instance for Azure Marketplace request<br />
HttpClient client = new HttpClient();</p>
<p>//send to data market<br />
HttpResponseMessage dataMarketResponse = await client.PostAsync(translatorAccessURI, requestContent);</p>
<p>// If client authentication failed then we get a JSON response from Azure Market Place<br />
if (!dataMarketResponse.IsSuccessStatusCode)<br />
{<br />
JToken error = await dataMarketResponse.Content.ReadAsAsync&lt;JToken&gt;();<br />
string errorType = error.Value&lt;string&gt;(&#8220;error&#8221;);<br />
string errorDescription = error.Value&lt;string&gt;(&#8220;error_description&#8221;);<br />
throw new HttpRequestException(string.Format(&#8220;Azure market place request failed: {0} {1}&#8221;, errorType, errorDescription));<br />
}</p>
<p>// Get the access token to attach to the original request from the response body<br />
string token = await dataMarketResponse.Content.ReadAsStringAsync();//&lt;JToken&gt;();<br />
// string token = response.Value&lt;string&gt;();// &#8220;access_token&#8221;);// HttpUtility.UrlEncode(response.Value&lt;string&gt;(&#8220;access_token&#8221;));</p>
<p>return token;<br />
}</p></blockquote>
<p>So, now you can now expect all the Azure goodness in Translations as well.</p>
<p>Happy translation!!</p>
<p>खुश अनुवाद!   Glücklich Übersetzung!!    快乐的翻译!!   幸せな翻訳!   ترجمه مبارک!    Счастливый перевод!   ¡Traducción feliz!!!!    خوش ترجمہ!!    Traduction heureuse !!    Traduzione felice!!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://subodhnpushpak.wordpress.com/2016/10/28/text-translation-migrating-from-microsoft-datamarket-to-azure-cognitive-services/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/ca4dffc06c2219965b6c16d8705646c48cfbbec0bd22d82033a3b4cd4ed6f404?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">subodhnpushpak</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb6.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb7.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb8.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb9.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/10/image_thumb10.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Polymer, React and angular using Visual studio 2015</title>
		<link>https://subodhnpushpak.wordpress.com/2016/08/23/polymer-react-and-angular-using-visual-studio-2015/</link>
					<comments>https://subodhnpushpak.wordpress.com/2016/08/23/polymer-react-and-angular-using-visual-studio-2015/#respond</comments>
		
		<dc:creator><![CDATA[Subodh N Pushpak]]></dc:creator>
		<pubDate>Tue, 23 Aug 2016 13:03:40 +0000</pubDate>
				<category><![CDATA[Angular]]></category>
		<category><![CDATA[Polymer]]></category>
		<category><![CDATA[React]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Bower]]></category>
		<guid isPermaLink="false">http://subodhnpushpak.wordpress.com/?p=514</guid>

					<description><![CDATA[Web applications are getting more demanding and complex. One way to manage complex functionalities of the application is to break the functionalities into modules. There are many JavaScript libraries which provides this Componentization at the front-end side. With adoption of ECMAScript 6; the syntax and features for componentization of functionalities is easier than ever. There are several &#8230; <a href="https://subodhnpushpak.wordpress.com/2016/08/23/polymer-react-and-angular-using-visual-studio-2015/" class="more-link">Continue reading <span class="screen-reader-text">Polymer, React and angular using Visual studio&#160;2015</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Web applications are getting more demanding and complex. One way to manage complex functionalities of the application is to break the functionalities into modules. There are many JavaScript libraries which provides this <strong style="color:#222222;font-family:arial, sans-serif;font-size:16px;line-height:19.2px;">Componentization</strong> at the front-end side.</p>
<p>With adoption of ECMAScript 6; the syntax and features for componentization of functionalities is easier than ever. There are several libraries which provides for these. <a href="https://facebook.github.io/react/index.html" target="_blank">ReactJs</a>, <a href="https://www.polymer-project.org/1.0/" target="_blank">Polymer</a> and <a href="https://angular.io/" target="_blank">Angular</a> being the major ones.</p>
<p>These libraries can be majorly clubbed into two categories based on approach:</p>
<ol>
<li>Libraries based on futuristic <a href="http://webcomponents.org/" target="_blank">Web-components</a>. Good example is <a href="https://www.polymer-project.org/1.0/" target="_blank">Polymer</a></li>
<li>Libraries based on  own implementation of the component-based UI architecture. Good example is <a href="https://facebook.github.io/react/index.html" target="_blank">ReactJs</a></li>
</ol>
<p>Needless to mention; each of these libraries aim is to share the same idea of componentization.</p>
<p><strong>ReactJs</strong> : is the JavaScript library that allows to decompose UI into small reusable Components developed by Facebook. ReactJs allows to create isomorphic applications, meaning that components are being rendered on the server and in the browser in the same way. It’s a very important feature that influences load time, SEO and performance in general.</p>
<p><strong>Polymer</strong>: is the library to create reusable web-components developed by Google.</p>
<p>Here is a quick start on getting your hands wet on these technologies using <strong>Visual Studio 2015 Update 3</strong></p>
<p><strong>Polymer</strong></p>
<p>Polymer is about <a href="http://webcomponents.org/" target="_blank">Web Components</a>. Web components allows to describe new types of elements with their properties and methods that encapsulates their DOM and styles. Web components have 4 specifications:</p>
<ol>
<li><strong>Templates</strong> :  The template element is used to declare fragments of HTML that can be cloned and inserted in the document by script.</li>
<li><strong>Shodow DOM</strong> : This specification describes a method of combining multiple DOM trees into one hierarchy and how these trees interact with each other within a document, thus enabling better composition of the DOM.</li>
<li><strong>Custom elements</strong>: describes the method for enabling the author to define and use new types of DOM elements in a document.</li>
<li><strong>HTML Imports</strong> : a way to include and reuse HTML documents in other HTML documents.</li>
</ol>
<p>Lets build a webapplication using polymer and Visual studio 2015. We will be using Bower integration with VS2015</p>
<p>create a new application<br />
 <img style="float:left;" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture1.png" alt="" width="1152" height="601" /></p>
<p>Select the<strong> ASP .Net 5.0 template (Preferably WEB API)</strong></p>
<p><img style="vertical-align:text-top;" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture2.png" alt="" width="984" height="767" /></p>
<p>Visual Studio will create the boiler plate code from the template</p>
<p><img style="vertical-align:text-top;" src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture3.png" alt="" width="1354" height="733" /></p>
<p>Here is how the Solution will look like</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture4.png" alt="" width="731" height="783" /></p>
<p>Go to startup.cs and <strong>comment the lines</strong> <strong>app.UseMvc();. We are interested in serving static files. </strong></p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture51.png" alt="" width="1106" height="665" /></p>
<p>Add a HTML file; index.html</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture6.png" alt="" width="1182" height="817" /></p>
<p>Right click on project -&gt; open properties and set the launch page to html page just created</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture7.png" alt="" width="1549" height="877" /></p>
<p>Add a <a href="https://bower.io/" target="_blank">Bower</a> file by selecting add new file -&gt; client side &#8211; &gt; bower configuration file</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture8.png" alt="" width="1178" height="816" /></p>
<p>Add below line in bower.json file</p>
<p>    &#8220;polymer&#8221;: &#8220;Polymer/polymer#^1.0.0&#8221;,</p>
<p>    &#8220;iron-icon&#8221;: &#8220;PolymerElements/iron-icon#^1.0.0&#8221;,</p>
<p>    &#8220;iron-icons&#8221;: &#8220;PolymerElements/iron-icons#^1.0.0&#8221; </p>
<p>By above, we are puling the library for polymer and iron icons.</p>
<p>The file now looks like:</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture9.png" alt="" width="1920" height="1039" /></p>
<p> If the above operation is successful, a lib folder is created in wwwroot folder.</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture10.png" alt="" width="718" height="629" /></p>
<p>Now lets code our first polymer webcomponent</p>
<p>Add a new html file; by right click on wwwroot folder and addig a new html file. Name it my-component.html.</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture11.png" alt="" width="1178" height="816" /></p>
<p> </p>
<p>Here is the code for my-component.html</p>
<p>&lt;dom-module id=&#8221;my-component&#8221;&gt;</p>
<p>    &lt;template&gt;</p>
<p>        &lt;style&gt;</p>
<p>            /* local DOM styles go here */</p>
<p>            :host {</p>
<p>                display: inline-block;</p>
<p>            }</p>
<p> </p>
<p>            iron-icon {</p>
<p>                fill: rgba(0,0,0,0);</p>
<p>                stroke: currentcolor;</p>
<p>            }</p>
<p> </p>
<p>            :host([pressed]) iron-icon {</p>
<p>                fill: currentcolor;</p>
<p>            }</p>
<p>        &lt;/style&gt;</p>
<p>        &lt;!&#8211; local DOM goes here &#8211;&gt;</p>
<p>       </p>
<div>
<p>            [[iconName]]</p>
<p>        </p></div>
<p>       </p>
<div>
<p>            </p>
<p>        </p></div>
<p>       </p>
<div>
<p>            Status:  [[pressed]]</p>
<p>        </p></div>
<p> </p>
<p>    &lt;/template&gt;</p>
<p>   </p>
<p>        Polymer({</p>
<p>            /* this is the element&#8217;s prototype */</p>
<p>            is: &#8216;my-component&#8217;,</p>
<p>            properties: {</p>
<p>                iconName: String,</p>
<p>                pressed: {</p>
<p>                    type: Boolean,</p>
<p>                    value: false,</p>
<p>                    notify: true,</p>
<p>                    reflectToAttribute: true</p>
<p>                }</p>
<p>            },</p>
<p>            listeners: {</p>
<p>                &#8216;tap&#8217;: &#8216;toggle&#8217;</p>
<p>            },</p>
<p>            toggle: function () {</p>
<p>                this.pressed = !this.pressed;</p>
<p>            },</p>
<p>        });</p>
<p>   </p>
<p>&lt;/dom-module&gt;</p>
<p> </p>
<p>Change index.html code to</p>
<p>&lt;!DOCTYPE html&gt;</p>
<p>&lt;html&gt;</p>
<p>&lt;head&gt;</p>
<p>    &lt;meta charset=&#8221;utf-8&#8243; /&gt;</p>
<p>    &lt;title&gt;Polymer Demo&lt;/title&gt;</p>
<p>    <a href="/lib/webcomponentsjs/webcomponents.js">/lib/webcomponentsjs/webcomponents.js</a></p>
<p>    &lt;link rel=&#8221;import&#8221; href=&#8221;lib/polymer/polymer.html&#8221; /&gt;</p>
<p>    &lt;link rel=&#8221;import&#8221; href=&#8221;lib/iron-icons/iron-icons.html&#8221;&gt;</p>
<p>    &lt;link rel=&#8221;import&#8221; href=&#8221;my-component.html&#8221;&gt;</p>
<p>   </p>
<p>        /*</p>
<p>        window.Polymer = window.Polymer || {};</p>
<p>        window.Polymer.dom = &#8216;shadow&#8217;;</p>
<p>        */</p>
<p>   </p>
<p> </p>
<p>&lt;/head&gt;</p>
<p>&lt;body&gt;</p>
<p>    Polymer Play!!! </p>
<p>   </p>
<div>
<p>        my-component</strong> icon-name=&#8221;polymer&#8221; pressed&gt;my-component</strong>&gt;</p>
<p>    </p></div>
<p>   </p>
<div>
<p>        </p>
<p>    </p></div>
<p>   </p>
<div>
<p>        </p>
<p>    </p></div>
<p> </p>
<p>&lt;/body&gt;</p>
<p>&lt;/html&gt;</p>
<p> </p>
<p>Run the application:</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture12.png" alt="" width="1096" height="588" /></p>
<p>If you are getting the above output; voila. the first webcomponent is running. Try toggling the icons by tapping on it.</p>
<p>Now lets use some of the pre-built elements:</p>
<p>You can find these at  <a href="https://www.polymer-project.org/1.0/toolbox/">https://www.polymer-project.org/1.0/toolbox/</a></p>
<p>Polymer supports various elements; here is a brief overview:</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture15.png" alt="" width="1131" height="856" /></p>
<p>Lets add paper elements to the Demo</p>
<p>Add below lines to bower.json file and save. Bower will pull down the required library</p>
<p>{</p>
<p>&#8220;name&#8221;: &#8220;ASP.NET&#8221;,</p>
<p>&#8220;private&#8221;: true,</p>
<p>  &#8220;dependencies&#8221;: {</p>
<p>    &#8220;polymer&#8221;: &#8220;Polymer/polymer#^1.0.0&#8221;,</p>
<p>    &#8220;iron-icon&#8221;: &#8220;PolymerElements/iron-icon#^1.0.0&#8221;,</p>
<p>    &#8220;iron-icons&#8221;: &#8220;PolymerElements/iron-icons#^1.0.0&#8221;,</p>
<p>    &#8220;paper-button&#8221;: &#8220;PolymerElements/paper-button#^1.0.0&#8221;,</p>
<p>    &#8220;paper-card&#8221;: &#8220;PolymerElements/paper-card#^1.0.0&#8243;</p>
<p>  }</p>
<p>}</p>
<p> </p>
<p>Add link at top of index.html page</p>
<p>&lt;link rel=&#8221;import&#8221; href=&#8221;lib/paper-button/paper-button.html&#8221; /&gt;</p>
<p>    &lt;link rel=&#8221;import&#8221; href=&#8221;lib/paper-material/paper-material.html&#8221;&gt;</p>
<p> </p>
<p>Add below code in index.html page</p>
<p> Some paper Button with inbuilt material styles</p>
<p>   </p>
<div>
<p>        Flat button</p>
<p>        Raised button</p>
<p>        No ripple effect</p>
<p>        Toggle-able button</p>
<p>        Say Hello</p>
<p>    </p></div>
<p> </p>
<p>   &lt;link rel=&#8221;import&#8221; href=&#8221;lib/paper-card/paper-card.html&#8221;&gt;</p>
<p> </p>
<p> </p>
<p> </p>
<p>&lt;</p>
<p>div&gt;</p>
<p>       </p>
<p>           </p>
<div class="card-content">
<p>               This is polymer paper card. It uses the my omponent as star rating</p>
<p>            </p></div>
<p>           </p>
<div class="cafe-rating">
<p>                </p>
<p>                </p>
<p>                </p>
<p>                </p>
<p>                </p>
<p>            </p></div>
<p>           </p>
<div class="card-actions">
<p>                Share</p>
<p>                Explore!</p>
<p>            </p></div>
<p>        &lt;/paper-card&gt;</p>
<p>    &lt;/div&gt;</p>
<p>The output you will get is:</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture14.png" alt="" width="1920" height="1030" /></p>
<p> </p>
<p>So the polymer app is ready. <a href="https://1drv.ms/u/s!AmdO_oUG25SdnYxqWpElRpn1qvHq6w" target="_blank">If you want the code; please download it here</a></p>
<p> </p>
<p>In next blog we will explore React!!!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://subodhnpushpak.wordpress.com/2016/08/23/polymer-react-and-angular-using-visual-studio-2015/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/ca4dffc06c2219965b6c16d8705646c48cfbbec0bd22d82033a3b4cd4ed6f404?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">subodhnpushpak</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture1.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture2.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture3.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture4.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture51.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture6.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture7.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture8.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture9.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture10.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture11.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture12.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture15.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2016/08/capture14.png" medium="image" />
	</item>
		<item>
		<title>Azure Data Platform &#038; Structured Storage</title>
		<link>https://subodhnpushpak.wordpress.com/2015/04/23/azure-data-platform-structured-storage/</link>
					<comments>https://subodhnpushpak.wordpress.com/2015/04/23/azure-data-platform-structured-storage/#respond</comments>
		
		<dc:creator><![CDATA[Subodh N Pushpak]]></dc:creator>
		<pubDate>Thu, 23 Apr 2015 12:36:33 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Windows Azure]]></category>
		<guid isPermaLink="false">http://subodhnpushpak.wordpress.com/?p=507</guid>

					<description><![CDATA[Cretaing and provisioning Azure SQL server using new azure portal https://info.microsoft.com/IN-Azure-WBNR-FY15-04Apr-AzureDataPlatformStructuredStorage-Apr23.html?ls=Website Visit https://portal.azure.com/ add new          open when DB created use open in Visual studio to create tables in the database use Price tier to scale DB at runtime use geo replication&#8230; Switch on auditing Access database via Sql server management tool or &#8230; <a href="https://subodhnpushpak.wordpress.com/2015/04/23/azure-data-platform-structured-storage/" class="more-link">Continue reading <span class="screen-reader-text">Azure Data Platform &#38; Structured&#160;Storage</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Cretaing and provisioning Azure SQL server using new azure portal</p>
<p><a href="https://info.microsoft.com/IN-Azure-WBNR-FY15-04Apr-AzureDataPlatformStructuredStorage-Apr23.html?ls=Website" target="_blank">https://info.microsoft.com/IN-Azure-WBNR-FY15-04Apr-AzureDataPlatformStructuredStorage-Apr23.html?ls=Website</a></p>
<p>Visit https://portal.azure.com/</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2015/04/capture.png" alt="" /></p>
<p>add new</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2015/04/capture1.png" alt="" width="300" height="818" />        <img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2015/04/capture2.png" alt="" /></p>
<p>open when DB created</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2015/04/capture3.png" alt="" /></p>
<p>use open in Visual studio to create tables in the database</p>
<p>use Price tier to scale DB at runtime</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2015/04/capture4.png" alt="" /></p>
<p>use geo replication&#8230;</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2015/04/capture5.png" alt="" /></p>
<p>Switch on auditing</p>
<p><img src="https://subodhnpushpak.wordpress.com/wp-content/uploads/2015/04/capture6.png" alt="" /></p>
<p><strong>Access database via Sql server management tool or grammatically using EDMX / ADO</strong></p>
<p>CREATE TABLE [dbo].[Person] (</p>
<p>[Id]   [int] IDENTITY(1,1) NOT NULL,</p>
<p>[Name] <a href="100">nvarchar</a> NOT NULL,</p>
<p>[Age] [int] NULL,</p>
<p>PRIMARY KEY CLUSTERED ([Id] ASC)</p>
<p>);</p>
<p>CREATE TABLE [dbo].[Session]</p>
<p>(</p>
<p>[Id] INT NOT NULL PRIMARY KEY IDENTITY,</p>
<p>[SessionName] NVARCHAR(50) NULL,</p>
<p>[PersonId] INT NULL,</p>
<p>CONSTRAINT [FK<em>Table</em>ToTable] FOREIGN KEY (PersonId) REFERENCES <a href="Id">Person</a></p>
<p>)</p>
<p>public void TestMethod1()</p>
<p>{</p>
<p>CreateData();</p>
<p>var data  = GetData();</p>
<p>foreach (var d in data)</p>
<p>{</p>
<p>Debug.WriteLine(&#8220;{0}: {1}: {2}&#8221;, d.Id, d.Name, d.Age);</p>
<p>}</p>
<p>Assert.IsNotNull(data);</p>
<p>}</p>
<p>public void CreateData()</p>
<p>{</p>
<p>using (var dbContext = new demo1Entities())</p>
<p>{</p>
<p>for (int i = 0; i &lt; 10; i++)</p>
<p>{</p>
<p>Person p = new Person() { Age = 20 + i, Name = &#8220;abc&#8221; + i };</p>
<p>dbContext.People.Add(p);</p>
<p>}</p>
<p>dbContext.SaveChanges();</p>
<p>}</p>
<p>}</p>
<p>public List&lt;Person&gt; GetData()</p>
<p>{</p>
<p>using (var dbContext = new demo1Entities())</p>
<p>{</p>
<p>var q = from p in dbContext.People</p>
<p>select p;</p>
<p>return q.ToList();</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p>[TestMethod]</p>
<p>public void TestMethodUpdate()</p>
<p>{</p>
<p>var data = UpdateData();</p>
<p>Debug.WriteLine(&#8220;{0}: {1}: {2}: {3}&#8221;, data.Id, data.Name, data.Age, data.Sessions.Count);</p>
<p>Assert.IsNotNull(data);</p>
<p>}</p>
<p>public Person UpdateData()</p>
<p>{</p>
<p>using (var dbContext = new demo1Entities())</p>
<p>{</p>
<p>var q = (from p in dbContext.People</p>
<p>where p.Id ==1</p>
<p>select p).FirstOrDefault();</p>
<p>if (q != null)</p>
<p>{</p>
<p>Session s = new Session() { SessionName = &#8220;Azure&#8221; };</p>
<p>q.Sessions.Add(s);</p>
<p>dbContext.SaveChanges();</p>
<p>}</p>
<p>return q;</p>
<p>}</p>
<p>}</p>
<table>
<tbody>
<tr>
<td> </td>
</tr>
</tbody>
</table>
<p>here is the slide deck</p>
<p><a href=""></a></p>
<div style="margin-bottom:5px;"><strong> <a title="Azure data platform &amp; structured storage" href="//www.slideshare.net/spushpak/azure-data-platform-structured-storage" target="_blank">Azure data platform &amp; structured storage</a> </strong> from <strong><a href="//www.slideshare.net/spushpak" target="_blank">Subodh Pushpak</a></strong></div>
<p><div class="jetpack-video-wrapper"><iframe src='https://www.slideshare.net/slideshow/embed_code/47327190' width='1100' height='901' sandbox="allow-popups allow-scripts allow-same-origin allow-presentation" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></p>
]]></content:encoded>
					
					<wfw:commentRss>https://subodhnpushpak.wordpress.com/2015/04/23/azure-data-platform-structured-storage/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/ca4dffc06c2219965b6c16d8705646c48cfbbec0bd22d82033a3b4cd4ed6f404?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">subodhnpushpak</media:title>
		</media:content>

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2015/04/capture.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2015/04/capture1.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2015/04/capture2.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2015/04/capture3.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2015/04/capture4.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2015/04/capture5.png" medium="image" />

		<media:content url="https://subodhnpushpak.wordpress.com/wp-content/uploads/2015/04/capture6.png" medium="image" />
	</item>
		<item>
		<title>Xamarin &#8211; Day 3 Advance Android</title>
		<link>https://subodhnpushpak.wordpress.com/2015/03/12/xamarin-day-3-advance-android/</link>
					<comments>https://subodhnpushpak.wordpress.com/2015/03/12/xamarin-day-3-advance-android/#respond</comments>
		
		<dc:creator><![CDATA[Subodh N Pushpak]]></dc:creator>
		<pubDate>Thu, 12 Mar 2015 05:06:41 +0000</pubDate>
				<category><![CDATA[Metro Apps, Win8, ASP .NET Web API, iOS, iPAd]]></category>
		<guid isPermaLink="false">http://subodhnpushpak.wordpress.com/?p=491</guid>

					<description><![CDATA[This post will cover below concepts on Xamarin Android Fragments Why fragments Catering to multiple form factors Services GPS Maps Camera Fragments &#8211; Create a fragment public static Fragment1 NewInstance() { var frag = new Fragment1 { Arguments = new Bundle() }; return frag; } public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { &#8230; <a href="https://subodhnpushpak.wordpress.com/2015/03/12/xamarin-day-3-advance-android/" class="more-link">Continue reading <span class="screen-reader-text">Xamarin &#8211; Day 3 Advance&#160;Android</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>This post will cover below concepts on Xamarin Android</p>
<ul>
<li>Fragments</li>
<li>Why fragments</li>
<li>Catering to multiple form factors</li>
<li>Services</li>
<li>GPS</li>
<li>Maps</li>
<li>Camera</li>
</ul>
<p><div class="jetpack-video-wrapper"><iframe src='https://www.slideshare.net/slideshow/embed_code/45732803' width='1100' height='901' sandbox="allow-popups allow-scripts allow-same-origin allow-presentation" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></p>
<p><iframe src="https://onedrive.live.com/embed?cid=9D94DB0685FE4E67&#038;resid=9d94db0685fe4e67%21236014&#038;authkey=AIx-Q1ZSt9vnyZA" width="165" height="128" frameborder="0" scrolling="no"></iframe></p>
<p><span style="color:#3366ff;font-size:18pt;">Fragments &#8211; Create a fragment</span></p>
<p>public static Fragment1 NewInstance()</p>
<p>{</p>
<p>var frag = new Fragment1 { Arguments = new Bundle() };</p>
<p>return frag;</p>
<p>}</p>
<p>public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)</p>
<p>{</p>
<p>base.OnCreateView(inflater, container, savedInstanceState);</p>
<p>var view = inflater.Inflate(Resource.Layout.fragment1View, null);</p>
<p>return view;</p>
<p>}</p>
<p><span style="color:#3366ff;font-size:18pt;">Container View</span></p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;</p>
<p>&lt;LinearLayout xmlns:android=&#8221;<a href="http://schemas.android.com/apk/res/android&#038;#8221" rel="nofollow">http://schemas.android.com/apk/res/android&#038;#8221</a>;</p>
<p>android:orientation=&#8221;vertical&#8221;</p>
<p>android:layout<em>width=&#8221;fill</em>parent&#8221;</p>
<p>android:layout<em>height=&#8221;fill</em>parent&#8221;</p>
<p>android:minWidth=&#8221;25px&#8221;</p>
<p>android:minHeight=&#8221;25px&#8221;</p>
<p>android:background=&#8221;#fff000&#8243;&gt;</p>
<p>&lt;TextView</p>
<p>android:text=&#8221;Fragment1&#8243;</p>
<p>android:textAppearance=&#8221;?android:attr/textAppearanceLarge&#8221;</p>
<p>android:layout<em>width=&#8221;match</em>parent&#8221;</p>
<p>android:layout<em>height=&#8221;wrap</em>content&#8221;</p>
<p>android:id=&#8221;@+id/textView1&#8243;</p>
<p>android:layout_marginBottom=&#8221;18.4dp&#8221; /&gt;</p>
<p>&lt;/LinearLayout&gt;</p>
<p><span style="color:#3366ff;font-size:18pt;">Invoking via code</span></p>
<p>&lt;FrameLayout</p>
<p>android:minWidth=&#8221;25px&#8221;</p>
<p>android:minHeight=&#8221;25px&#8221;</p>
<p>android:layout<em>width=&#8221;wrap</em>content&#8221;</p>
<p>android:layout<em>height=&#8221;wrap</em>content&#8221;</p>
<p>android:id=&#8221;@+id/frameLayout1&#8243;&gt;</p>
<p>void showFragment(int position)</p>
<p>{</p>
<p>Fragment fragment = null;</p>
<p>switch (position)</p>
<p>{</p>
<p>case 0:</p>
<p>fragment = fragment1.NewInstance();</p>
<p>break;</p>
<p>case 1:</p>
<p>fragment = Fragment2.NewInstance();</p>
<p>break;</p>
<p>}</p>
<p>FragmentManager.BeginTransaction()</p>
<p>.Replace(Resource.Id.frameLayout1, fragment)</p>
<p>.Commit();</p>
<p>}</p>
<p><span style="color:#3366ff;font-size:18pt;">using fragment in view axml</span></p>
<p>&lt;fragment</p>
<p>class=&#8221;androidfragmentpoc.Fragments.fragment1&#8243;</p>
<p>android:id=&#8221;@+id/fragment1&#8243;</p>
<p>android:layout<em>width=&#8221;wrap</em>content&#8221;</p>
<p>android:layout<em>height=&#8221;wrap</em>content&#8221; /&gt;</p>
<p>&lt;FrameLayout</p>
<p>android:minWidth=&#8221;25px&#8221;</p>
<p>android:minHeight=&#8221;25px&#8221;</p>
<p>android:layout<em>width=&#8221;wrap</em>content&#8221;</p>
<p>android:layout<em>height=&#8221;wrap</em>content&#8221;</p>
<p>android:id=&#8221;@+id/frameLayout1&#8243;&gt;</p>
<p>&lt;fragment</p>
<p>class=&#8221;androidfragmentpoc.Fragments.Fragment2&#8243;</p>
<p>android:id=&#8221;@+id/fragment2&#8243;</p>
<p>android:layout<em>width=&#8221;wrap</em>content&#8221;</p>
<p>android:layout<em>height=&#8221;wrap</em>content&#8221; /&gt;</p>
<p>&lt;/FrameLayout&gt;</p>
<p><span style="color:#3366ff;font-size:18pt;">Setting value to frag view</span></p>
<p>public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)</p>
<p>{</p>
<p>base.OnCreateView(inflater, container, savedInstanceState);</p>
<p>var view = inflater.Inflate(Resource.Layout.fragment2View, null);</p>
<p>var txt = view.FindViewById&lt;TextView&gt;(Resource.Id.textView1);</p>
<p>txt.Text = @&#8221;modified text&#8221;;</p>
<p>return view;</p>
<p>}</p>
<p><span style="color:#3366ff;font-size:18pt;">Using Service</span></p>
<p>[Service]</p>
<p>public class DemoService : Service</p>
<p>{</p>
<p>string tag = &#8220;DemoService&#8221;;</p>
<p>public override IBinder OnBind(Intent intent)</p>
<p>{</p>
<p>return null; //null started service</p>
<p>}</p>
<p>public override StartCommandResult OnStartCommand(Intent intent, StartCommandFlags flags, int startId)</p>
<p>{</p>
<p>Log.Info(tag, &#8220;OnStartCommand()&#8221;);</p>
<p>showToast(&#8220;OnStartCommand()&#8221;);</p>
<p>showNotification(0, &#8220;services&#8221;, &#8220;OnStartCommand&#8221;);</p>
<p>DoWork();</p>
<p>//return base.OnStartCommand(intent, flags, startId);</p>
<p>return StartCommandResult.NotSticky;</p>
<p>}</p>
<p>public void DoWork()</p>
<p>{</p>
<p>Log.Info(tag, &#8220;Doing work&#8221;);</p>
<p>var t = new Thread(() =&gt;</p>
<p>{</p>
<p>Thread.Sleep(2000);</p>
<p>Log.Info(tag, &#8220;Work complete&#8221;);</p>
<p>showNotification(1,&#8221;from thread&#8221;, &#8220;Work completed&#8221;);</p>
<p>StopSelf();</p>
<p>}</p>
<p>);</p>
<p>t.Start();</p>
<p>}</p>
<p>public override void OnDestroy()</p>
<p>{</p>
<p>Log.Info(tag, &#8220;OnDestroy()&#8221;);</p>
<p>base.OnDestroy();</p>
<p>showToast(&#8220;OnDestroy()&#8221;);</p>
<p>}</p>
<p>public void showToast(string message)</p>
<p>{</p>
<p>var myHandler = new Handler();</p>
<p>myHandler.Post(() =&gt;</p>
<p>{</p>
<p>Toast.MakeText(this, message, ToastLength.Long).Show();</p>
<p>});</p>
<p>}</p>
<p>public void showNotification(int notificationId, string title, string message)</p>
<p>{</p>
<p>// Instantiate the builder and set notification elements:</p>
<p>Notification.Builder builder = new Notification.Builder(this)</p>
<p>.SetContentTitle(title)</p>
<p>.SetContentText(message)</p>
<p>.SetSmallIcon(Resource.Drawable.Icon);</p>
<p>// Build the notification:</p>
<p>Notification notification = builder.Notification;</p>
<p>// Get the notification manager:</p>
<p>NotificationManager notificationManager =</p>
<p>GetSystemService(Context.NotificationService) as NotificationManager;</p>
<p>// Publish the notification:</p>
<p>//const int notificationId = 0;</p>
<p>notificationManager.Notify(notificationId, notification);</p>
<p>}</p>
<p>}</p>
<p>void button2_Click(object sender, EventArgs e)</p>
<p>{</p>
<p>StopService(new Intent(this, typeof(DemoService)));</p>
<p>}</p>
<p>void button1_Click(object sender, EventArgs e)</p>
<p>{</p>
<p>StartService(new Intent(this, typeof(DemoService)));</p>
<p>}</p>
<p><span style="color:#3366ff;font-size:18pt;">using Location</span></p>
<p>implement ILocationListener in Activity</p>
<p>TextView latitude;</p>
<p>TextView longitude;</p>
<p>LocationManager locMgr;</p>
<p>protected override void OnCreate(Bundle bundle)</p>
<p>{</p>
<p>base.OnCreate(bundle);</p>
<p>SetContentView(Resource.Layout.locationView);</p>
<p>latitude = FindViewById&lt;TextView&gt;(Resource.Id.textView1);</p>
<p>longitude = FindViewById&lt;TextView&gt;(Resource.Id.textView2);</p>
<p>var b = FindViewById&lt;Button&gt;(Resource.Id.button1);</p>
<p>b.Click += (o,e)=&gt;{</p>
<p>//string uri = string.Format(&#8220;google.streetview:cbll={0},{1}&amp;cbp=1,yaw,,pitch,zoom&amp;mz=20&#8221;, latitude, longitude);</p>
<p>string uri = string.Format(&#8220;geo:{0},{1}&#8221;, latitude, longitude);</p>
<p>var geoUri = Android.Net.Uri.Parse(uri);</p>
<p>var mapIntent = new Intent(Intent.ActionView, geoUri);</p>
<p>StartActivity(mapIntent);</p>
<p>};</p>
<p>getLocationProvider();</p>
<p>}</p>
<p>// set ACCESS<em>FINE</em>LOCATION</p>
<p>string getLocationProvider()</p>
<p>{</p>
<p>Criteria locationCriteria = new Criteria();</p>
<p>locationCriteria.Accuracy = Accuracy.Coarse;</p>
<p>locationCriteria.PowerRequirement = Power.Medium;</p>
<p>locMgr = GetSystemService(Context.LocationService) as LocationManager;</p>
<p>var locationProvider = locMgr.GetBestProvider(locationCriteria, true);</p>
<p>if (locationProvider != null)</p>
<p>{</p>
<p>locMgr.RequestLocationUpdates(locationProvider, 2000, 1, this);</p>
<p>}</p>
<p>else</p>
<p>{</p>
<p>//Log.Info(Debug, &#8220;No location providers available&#8221;);</p>
<p>}</p>
<p>return locationProvider;</p>
<p>}</p>
<p>public void OnLocationChanged(Location location)</p>
<p>{</p>
<p>latitude.Text = &#8220;Latitude: &#8221; + location.Latitude;</p>
<p>longitude.Text = &#8220;Longitude: &#8221; + location.Longitude;</p>
<p>}</p>
<p><span style="color:#3366ff;font-size:18pt;">Using Camera</span></p>
<p>&lt;uses-permission android:name=&#8221;android.permission.ACCESS<em>FINE</em>LOCATION&#8221; /&gt;</p>
<p>&lt;uses-permission android:name=&#8221;android.permission.WRITE<em>EXTERNAL</em>STORAGE&#8221; /&gt;</p>
<p>&lt;uses-permission android:name=&#8221;android.permission.CAMERA&#8221; /&gt;</p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;</p>
<p>&lt;LinearLayout xmlns:android=&#8221;<a href="http://schemas.android.com/apk/res/android&#038;#8221" rel="nofollow">http://schemas.android.com/apk/res/android&#038;#8221</a>;</p>
<p>android:orientation=&#8221;vertical&#8221;</p>
<p>android:layout<em>width=&#8221;fill</em>parent&#8221;</p>
<p>android:layout<em>height=&#8221;fill</em>parent&#8221;&gt;</p>
<p>&lt;Button</p>
<p>android:text=&#8221;Button&#8221;</p>
<p>android:layout<em>width=&#8221;match</em>parent&#8221;</p>
<p>android:layout<em>height=&#8221;wrap</em>content&#8221;</p>
<p>android:id=&#8221;@+id/button1&#8243; /&gt;</p>
<p>&lt;ImageView</p>
<p>android:src=&#8221;@android:drawable/ic<em>menu</em>gallery&#8221;</p>
<p>android:layout<em>width=&#8221;match</em>parent&#8221;</p>
<p>android:layout<em>height=&#8221;wrap</em>content&#8221;</p>
<p>android:id=&#8221;@+id/imageView1&#8243; /&gt;</p>
<p>&lt;/LinearLayout&gt;</p>
<p>public class CameraActivity : Activity</p>
<p>{</p>
<p>string filePath = string.Empty;</p>
<p>File _dir;</p>
<p>File _file;</p>
<p>Bitmap bitmap;</p>
<p>ImageView imageView;</p>
<p>protected override void OnCreate(Bundle bundle)</p>
<p>{</p>
<p>base.OnCreate(bundle);</p>
<p>SetContentView(Resource.Layout.cameraView);</p>
<p>var b = FindViewById&lt;Button&gt;(Resource.Id.button1);</p>
<p>b.Click += (o, e) =&gt;</p>
<p>{</p>
<p>TakeAPicture();</p>
<p>};</p>
<p>imageView = FindViewById&lt;ImageView&gt;(Resource.Id.imageView1);</p>
<p>}</p>
<p>private void CreateDirectoryForPictures()</p>
<p>{</p>
<p>_dir = new File(Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryPictures), &#8220;CameraAppDemo&#8221;);</p>
<p>if (!_dir.Exists())</p>
<p>{</p>
<p>_dir.Mkdirs();</p>
<p>}</p>
<p>}</p>
<p>private void TakeAPicture()</p>
<p>{</p>
<p>CreateDirectoryForPictures();</p>
<p>Intent intent = new Intent(MediaStore.ActionImageCapture);</p>
<p><em>file = new File(</em>dir, String.Format(&#8220;myPhoto_{0}.jpg&#8221;, Guid.NewGuid()));</p>
<p>intent.PutExtra(MediaStore.ExtraOutput, Android.Net.Uri.FromFile(_file));</p>
<p>StartActivityForResult(intent, 0);</p>
<p>}</p>
<p>protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)</p>
<p>{</p>
<p>base.OnActivityResult(requestCode, resultCode, data);</p>
<p>// make it available in the gallery</p>
<p>Intent mediaScanIntent = new Intent(Intent.ActionMediaScannerScanFile);</p>
<p>Android.Net.Uri contentUri = Android.Net.Uri.FromFile(_file);</p>
<p>mediaScanIntent.SetData(contentUri);</p>
<p>SendBroadcast(mediaScanIntent);</p>
<p>// display in ImageView. We will resize the bitmap to fit the display</p>
<p>// Loading the full sized image will consume to much memory</p>
<p>// and cause the application to crash.</p>
<p>int height = Resources.DisplayMetrics.HeightPixels;</p>
<p>int width = imageView.Width;</p>
<p>bitmap = LoadAndResizeBitmap(_file.Path, width, height);</p>
<p>if (bitmap != null)</p>
<p>{</p>
<p>imageView.SetImageBitmap(bitmap);</p>
<p>bitmap = null;</p>
<p>}</p>
<p>}</p>
<p>public static Bitmap LoadAndResizeBitmap(string fileName, int width, int height)</p>
<p>{</p>
<p>// First we get the the dimensions of the file on disk</p>
<p>BitmapFactory.Options options = new BitmapFactory.Options { InJustDecodeBounds = true };</p>
<p>BitmapFactory.DecodeFile(fileName, options);</p>
<p>// Next we calculate the ratio that we need to resize the image by</p>
<p>// in order to fit the requested dimensions.</p>
<p>int outHeight = options.OutHeight;</p>
<p>int outWidth = options.OutWidth;</p>
<p>int inSampleSize = 1;</p>
<p>if (outHeight &gt; height || outWidth &gt; width)</p>
<p>{</p>
<p>inSampleSize = outWidth &gt; outHeight</p>
<dl>
<dt>? outHeight / height</dt>
<dd>
outWidth / width;
</dd>
</dl>
<p>}</p>
<p>// Now we will load the image and have BitmapFactory resize it for us.</p>
<p>options.InSampleSize = inSampleSize;</p>
<p>options.InJustDecodeBounds = false;</p>
<p>Bitmap resizedBitmap = BitmapFactory.DecodeFile(fileName, options);</p>
<p>return resizedBitmap;</p>
<p>}</p>
<p>}</p>
]]></content:encoded>
					
					<wfw:commentRss>https://subodhnpushpak.wordpress.com/2015/03/12/xamarin-day-3-advance-android/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/ca4dffc06c2219965b6c16d8705646c48cfbbec0bd22d82033a3b4cd4ed6f404?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">subodhnpushpak</media:title>
		</media:content>
	</item>
		<item>
		<title>Xamarin Day 2 &#8211; Android Concepts</title>
		<link>https://subodhnpushpak.wordpress.com/2015/03/12/xamarin-day-2-android-concepts/</link>
					<comments>https://subodhnpushpak.wordpress.com/2015/03/12/xamarin-day-2-android-concepts/#respond</comments>
		
		<dc:creator><![CDATA[Subodh N Pushpak]]></dc:creator>
		<pubDate>Thu, 12 Mar 2015 04:49:18 +0000</pubDate>
				<category><![CDATA[Metro Apps, Win8, ASP .NET Web API, iOS, iPAd]]></category>
		<guid isPermaLink="false">http://subodhnpushpak.wordpress.com/?p=488</guid>

					<description><![CDATA[Using Xamarin you can code Android apps and deploy it on Android. This post discusses Android basics for the un-initiated and how to approach android platform using Visual Studio Xamarin day2 &#8211; Android with Xamarin from Subodh Pushpak Introduces MVC Activity lifecycle The View &#60;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&#62; &#60;LinearLayout xmlns:android=&#8221;http://schemas.android.com/apk/res/android&#038;#8221; android:orientation=&#8221;vertical&#8221; android:layoutwidth=&#8221;fillparent&#8221; android:layoutheight=&#8221;fillparent&#8221;&#62; &#60;EditText android:id=&#8221;@+id/txtview&#8221; android:layoutwidth=&#8221;fillparent&#8221; &#8230; <a href="https://subodhnpushpak.wordpress.com/2015/03/12/xamarin-day-2-android-concepts/" class="more-link">Continue reading <span class="screen-reader-text">Xamarin Day 2 &#8211; Android&#160;Concepts</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>Using Xamarin you can code Android apps and deploy it on Android. This post discusses Android basics for the un-initiated and how to approach android platform using Visual Studio</p>
<p><div class="jetpack-video-wrapper"><iframe src='https://www.slideshare.net/slideshow/embed_code/45732744' width='1100' height='901' sandbox="allow-popups allow-scripts allow-same-origin allow-presentation" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></p>
<div style="margin-bottom:5px;"><strong> <a title="Xamarin day2 - Android with Xamarin" href="//www.slideshare.net/spushpak/xamarin-day2" target="_blank">Xamarin day2 &#8211; Android with Xamarin</a> </strong> from <strong><a href="//www.slideshare.net/spushpak" target="_blank">Subodh Pushpak</a></strong></div>
<p><iframe src="https://onedrive.live.com/embed?cid=9D94DB0685FE4E67&#038;resid=9d94db0685fe4e67%21235838&#038;authkey=AH0KDt9yMx2F0xc" width="165" height="128" frameborder="0" scrolling="no"></iframe></p>
<p>Introduces</p>
<ul>
<li>MVC</li>
<li>Activity lifecycle</li>
</ul>
<p><span style="color:#3366ff;font-size:18pt;">The View</span></p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;</p>
<p>&lt;LinearLayout xmlns:android=&#8221;<a href="http://schemas.android.com/apk/res/android&#038;#8221" rel="nofollow">http://schemas.android.com/apk/res/android&#038;#8221</a>;</p>
<p>android:orientation=&#8221;vertical&#8221;</p>
<p>android:layout<em>width=&#8221;fill</em>parent&#8221;</p>
<p>android:layout<em>height=&#8221;fill</em>parent&#8221;&gt;</p>
<p>&lt;EditText</p>
<p>android:id=&#8221;@+id/txtview&#8221;</p>
<p>android:layout<em>width=&#8221;fill</em>parent&#8221;</p>
<p>android:layout<em>height=&#8221;wrap</em>content&#8221; /&gt;</p>
<p>&lt;Button</p>
<p>android:id=&#8221;@+id/MyButton&#8221;</p>
<p>android:layout<em>width=&#8221;fill</em>parent&#8221;</p>
<p>android:layout<em>height=&#8221;wrap</em>content&#8221;</p>
<p>android:text=&#8221;@string/Hello&#8221; /&gt;</p>
<p>&lt;/LinearLayout&gt;</p>
<p><span style="color:#3366ff;font-size:18pt;">The Activity</span></p>
<p>[Activity(Label = &#8220;Demo1&#8221;, MainLauncher = true, Icon = &#8220;@drawable/icon&#8221;)]</p>
<p>public class MainActivity : Activity</p>
<p>{</p>
<p>int count = 1;</p>
<p>protected override void OnCreate(Bundle bundle)</p>
<p>{</p>
<p>base.OnCreate(bundle);</p>
<p>// Set our view from the &#8220;main&#8221; layout resource</p>
<p>SetContentView(Resource.Layout.Main);</p>
<p>// Get our button from the layout resource,</p>
<p>// and attach an event to it</p>
<p>Button button = FindViewById&lt;Button&gt;(Resource.Id.MyButton);</p>
<p>var editText = FindViewById&lt;EditText&gt;(Resource.Id.txtview);</p>
<p>editText.Text = &#8220;Hello&#8221;;</p>
<p>button.Click += delegate { button.Text = string.Format(&#8220;{0} clicks!&#8221;, count++); };</p>
<p>}</p>
<p>}</p>
<p><span style="color:#3366ff;font-size:18pt;">Model</span></p>
<p>public class MyViewModel</p>
<p>{</p>
<p>public MyViewModel() { }</p>
<p>public int Id { get; set; }</p>
<p>public string Name { get; set; }</p>
<p>public string Designation { get; set; }</p>
<p>public string Index</p>
<p>{</p>
<p>get</p>
<p>{</p>
<p>return Text.Length == 0 ? &#8220;A&#8221; : Text[0].ToString().ToUpper();</p>
<p>}</p>
<p>}</p>
<p>}</p>
<p><span style="font-size:18pt;color:#3366ff;">Need to hide Titlebar??</span> Set the below properties in the attribute [Activity(Label = &#8220;Demo1&#8221;, MainLauncher = true, Icon = &#8220;@drawable/icon&#8221;)]</p>
<p>Theme = &#8220;@android:style/Theme.NoTitleBar&#8221;</p>
<p><span style="font-size:18pt;color:#3366ff;">Need to set Orienation</span></p>
<p>ScreenOrientation = ScreenOrientation.Portrait</p>
<p><span style="color:#3366ff;font-size:18pt;">Need Navigation?</span></p>
<p>void navigateToNextScreen(string txt)</p>
<p>{</p>
<p>Intent intent = new Intent();</p>
<p>intent.SetClass(this, typeof(Activity2));</p>
<p>intent.PutExtra(&#8220;txt&#8221;,txt);</p>
<p>StartActivity(intent);</p>
<p>}</p>
<p><span style="color:#3366ff;font-size:18pt;">Need to send parameters?</span></p>
<p>var txt = Intent.GetStringExtra(&#8220;txt&#8221;);</p>
<p><span style="color:#3366ff;font-size:18pt;">Need to show Dialog?</span></p>
<p>new AlertDialog.Builder(this).SetMessage(txtview.Text).Show();</p>
<p>Toast.MakeText(this, &#8220;The demo service has started&#8221;, ToastLength.Long).Show();</p>
<p><span style="font-size:18pt;"><span style="color:#3366ff;">Resources are handled uniquely in Android as respect to other platforms (iOS, Windows);</span></span></p>
<p><span style="font-size:18pt;color:#3366ff;">Declare a ImageView </span></p>
<p>&lt;ImageVie</p>
<p>android:layout<em>width=&#8221;fill</em>parent&#8221;</p>
<p>android:layout<em>height=&#8221;fill</em>parent&#8221;</p>
<p>android:id=&#8221;@+id/demoImageView&#8221;</p>
<p>android:src=&#8221;@drawable/fbicon&#8221;</p>
<p>android:scaleType=&#8221;fitCenter&#8221;/&gt;</p>
<p><span style="color:#3366ff;font-size:18pt;">Setting image source in code</span></p>
<p>imageView.SetImageResource (Resource.Drawable.sample2);</p>
<p><span style="color:#3366ff;font-size:18pt;">Working listView</span></p>
<p>public class MyListAdapter : BaseAdapter&lt;MyViewModel&gt;, ISectionIndexer</p>
<p>{</p>
<p>protected Activity context = null;</p>
<p>protected IList&lt;MyViewModel&gt; list = new List&lt;MyViewModel&gt;();</p>
<dl>
<dt>public MyListAdapter(Activity context, IList&lt;MyViewModel&gt; list)</dt>
<dd>
base()
</dd>
</dl>
<p>{</p>
<p>this.context = context;</p>
<p>if (list == null)</p>
<p>list = new List&lt;MyViewModel&gt;();</p>
<p>this.list = list;</p>
<p>}</p>
<p>public override MyViewModel this[int position]</p>
<p>{</p>
<p>get { return list[position]; }</p>
<p>}</p>
<p>public override long GetItemId(int position)</p>
<p>{</p>
<p>return position;</p>
<p>}</p>
<p>public override int Count</p>
<p>{</p>
<p>get</p>
<p>{</p>
<p>return list.Count;</p>
<p>}</p>
<p>}</p>
<p>public override View GetView(int position, View convertView, ViewGroup parent)</p>
<p>{</p>
<p>// Get our object for this position</p>
<p>var item = list[position];</p>
<p>var view = (convertView ??</p>
<p>context.LayoutInflater.Inflate(</p>
<p>Resource.Layout.listviewitem,</p>
<p>parent,</p>
<p>false)) as LinearLayout;</p>
<p>// Find references to each subview in the list item&#8217;s view</p>
<p>var bigTextView = view.FindViewById&lt;TextView&gt;(Resource.Id.textView1);</p>
<p>var smallTextView = view.FindViewById&lt;TextView&gt;(Resource.Id.textView2);</p>
<p>bigTextView.SetText(list[position].Name, TextView.BufferType.Normal);</p>
<p>smallTextView.SetText(list[position].Designation, TextView.BufferType.Normal);</p>
<p>//((Activity)context).RunOnUiThread(() =&gt;</p>
<p>//            {</p>
<p>//                imageview.SetImageBitmap(image);</p>
<p>//            });</p>
<p>return view;</p>
<p>}</p>
<p>public int GetPositionForSection(int section)</p>
<p>{</p>
<p>return 1;// alphaIndexer[sections[section]];</p>
<p>}</p>
<p>public int GetSectionForPosition(int position)</p>
<p>{</p>
<p>return 1;</p>
<p>}</p>
<p>public Java.Lang.Object[] GetSections()</p>
<p>{</p>
<p>return null;// sectionsO;</p>
<p>}</p>
<p>}</p>
<p><span style="color:#3366ff;font-size:18pt;">ListView in View</span></p>
<p>&lt;ListView</p>
<p>android:minWidth=&#8221;25px&#8221;</p>
<p>android:minHeight=&#8221;25px&#8221;</p>
<p>android:layout<em>width=&#8221;match</em>parent&#8221;</p>
<p>android:layout<em>height=&#8221;wrap</em>content&#8221;</p>
<p>android:id=&#8221;@+id/listView1&#8243; /&gt;</p>
<p><span style="color:#3366ff;font-size:18pt;">listItemView</span></p>
<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;</p>
<p>&lt;LinearLayout xmlns:android=&#8221;<a href="http://schemas.android.com/apk/res/android&#038;#8221" rel="nofollow">http://schemas.android.com/apk/res/android&#038;#8221</a>;</p>
<p>android:orientation=&#8221;vertical&#8221;</p>
<p>android:layout<em>width=&#8221;fill</em>parent&#8221;</p>
<p>android:layout<em>height=&#8221;fill</em>parent&#8221;</p>
<p>android:minWidth=&#8221;25px&#8221;</p>
<p>android:minHeight=&#8221;25px&#8221;&gt;</p>
<p>&lt;TextView</p>
<p>android:text=&#8221;Large Text&#8221;</p>
<p>android:textAppearance=&#8221;?android:attr/textAppearanceLarge&#8221;</p>
<p>android:layout<em>width=&#8221;match</em>parent&#8221;</p>
<p>android:layout<em>height=&#8221;wrap</em>content&#8221;</p>
<p>android:id=&#8221;@+id/textView1&#8243; /&gt;</p>
<p>&lt;TextView</p>
<p>android:text=&#8221;Small Text&#8221;</p>
<p>android:textAppearance=&#8221;?android:attr/textAppearanceSmall&#8221;</p>
<p>android:layout<em>width=&#8221;match</em>parent&#8221;</p>
<p>android:layout<em>height=&#8221;wrap</em>content&#8221;</p>
<p>android:id=&#8221;@+id/textView2&#8243; /&gt;</p>
<p>&lt;/LinearLayout&gt;</p>
<p><span style="color:#3366ff;font-size:18pt;">Code in Activity</span></p>
<p>SetContentView(Resource.Layout.mylistview);</p>
<p>listView = FindViewById&lt;ListView&gt;(Resource.Id.listView1);</p>
<p>if (listView != null)</p>
<p>{</p>
<p>listView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =&gt;</p>
<p>{</p>
<p>var intent = new Intent(this, typeof(Activity2));</p>
<p>intent.PutExtra(&#8220;txt&#8221;, getDummyData()[e.Position].Name);</p>
<p>StartActivity(intent);</p>
<p>};</p>
<p>}</p>
<p>loadList();</p>
<p>void loadList()</p>
<p>{</p>
<p>RunOnUiThread(() =&gt;</p>
<p>{</p>
<p>MyListAdapter adapter = new MyListAdapter(this, getDummyData());</p>
<p>adapter.NotifyDataSetChanged();</p>
<p>listView.Adapter = adapter;</p>
<p>});</p>
<p>}</p>
<p>List&lt;MyViewModel&gt; getDummyData()</p>
<p>{</p>
<p>List&lt;MyViewModel&gt; list = new List&lt;MyViewModel&gt;();</p>
<p>list.Add(new MyViewModel() { Id = 1, Name = &#8220;ABC&#8221;, Designation = &#8220;ccc&#8221; });</p>
<p>list.Add(new MyViewModel() { Id = 1, Name = &#8220;DEF&#8221;, Designation = &#8220;cded&#8221; });</p>
<p>list.Add(new MyViewModel() { Id = 1, Name = &#8220;ABC&#8221;, Designation = &#8220;ccc&#8221; });</p>
<p>return list;</p>
<p>}</p>
<p><span style="color:#3366ff;font-size:18pt;">Activity Lifecyle events</span></p>
<p>protected override void OnCreate(Bundle bundle)</p>
<p>{</p>
<p>base.OnCreate(bundle);</p>
<p>Log.Info(tag, &#8220;OnCreate()&#8221;);</p>
<p>}</p>
<p>protected override void OnStart()</p>
<p>{</p>
<p>base.OnStart();</p>
<p>Log.Info(tag, &#8220;OnStart()&#8221;);</p>
<p>}</p>
<p>protected override void OnResume()</p>
<p>{</p>
<p>base.OnResume();</p>
<p>Log.Info(tag, &#8220;OnResume()&#8221;);</p>
<p>}</p>
<p>protected override void OnPause()</p>
<p>{</p>
<p>base.OnPause();</p>
<p>Log.Info(tag, &#8220;OnPause()&#8221;);</p>
<p>}</p>
<p>protected override void OnStop()</p>
<p>{</p>
<p>base.OnStop();</p>
<p>Log.Info(tag, &#8220;OnStop()&#8221;);</p>
<p>}</p>
<p>protected override void OnDestroy()</p>
<p>{</p>
<p>base.OnDestroy();</p>
<p>Log.Info(tag, &#8220;OnDestroy()&#8221;);</p>
<p>}</p>
<p>protected override void OnRestart()</p>
<p>{</p>
<p>base.OnRestart();</p>
<p>Log.Info(tag, &#8220;OnRestart()&#8221;);</p>
<p>}</p>
<p>protected override void OnSaveInstanceState(Bundle outState)</p>
<p>{</p>
<p>base.OnSaveInstanceState(outState);</p>
<p>Log.Info(tag, &#8220;OnSaveInstanceState()&#8221;);</p>
<p>}</p>
<p>protected override void OnRestoreInstanceState(Bundle savedInstanceState)</p>
<p>{</p>
<p>base.OnRestoreInstanceState(savedInstanceState);</p>
<p>Log.Info(tag, &#8220;OnRestoreInstanceState()&#8221;);</p>
<p>}</p>
<p><span style="color:#3366ff;font-size:18pt;">logging</span></p>
<p>string tag = &#8220;myapp&#8221;;</p>
<p>Log.Info (tag, &#8220;this is an info message&#8221;);</p>
<p>Log.Warn (tag, &#8220;this is a warning message&#8221;);</p>
<p>Log.Error (tag, &#8220;this is an error message&#8221;);</p>
<p>Log.Info(tag, this.LocalClassName);</p>
<p>button.Click += delegate</p>
<p>{</p>
<p>Intent i = new Intent();</p>
<p>if (this.LocalClassName == &#8220;demotry.MainActivity&#8221;)</p>
<p>{</p>
<p>i.SetClass(this, typeof(Activity1));</p>
<p>}</p>
<p>else</p>
<p>{</p>
<p>i.SetClass(this, typeof(MainActivity));</p>
<p>}</p>
<p>StartActivity(i);</p>
<p>};</p>
<p><span style="color:#3366ff;font-size:18pt;">Working for WebView</span></p>
<p>&lt;WebView xmlns:android=&#8221;<a href="http://schemas.android.com/apk/res/android&#038;#8221" rel="nofollow">http://schemas.android.com/apk/res/android&#038;#8221</a>;</p>
<p>android:layout<em>width=&#8221;fill</em>parent&#8221;</p>
<p>android:layout<em>height=&#8221;fill</em>parent&#8221;</p>
<p>android:id=&#8221;@+id/LocalWebView&#8221;&gt;</p>
<p>&lt;/WebView&gt;</p>
<p>var webView = view.FindViewById&lt;WebView&gt;(Resource.Id.LocalWebView);</p>
<p>webView.LoadUrl(&#8220;<a href="http://xamarin.com&#038;#8221" rel="nofollow">http://xamarin.com&#038;#8221</a>;);</p>
<p><span style="color:#3366ff;font-size:18pt;">File read write</span></p>
<p>Utilities.CreateFile(&#8220;myfile.txt&#8221;, &#8220;this is content&#8221;);</p>
<p>string filecontent = Utilities.ReadFile(&#8220;myfile.txt&#8221;);</p>
<p>public class Utilities</p>
<p>{</p>
<p>public static void CreateFile(string fileName, string content)</p>
<p>{</p>
<p>string path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);</p>
<p>string filePath = System.IO.Path.Combine(path, fileName);</p>
<p>using (var file = File.Open(filePath, FileMode.Create, FileAccess.Write))</p>
<p>using (var strm = new StreamWriter(file))</p>
<p>{</p>
<p>strm.Write(content);</p>
<p>}</p>
<p>}</p>
<p>public static string ReadFile(string fileName)</p>
<p>{</p>
<p>string content = string.Empty;</p>
<p>string path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);</p>
<p>string filePath = System.IO.Path.Combine(path, fileName);</p>
<p>using (var file = File.Open(filePath, FileMode.Open, FileAccess.Read))</p>
<p>using (var strm = new StreamReader(file))</p>
<p>{</p>
<p>content = strm.ReadToEnd();</p>
<p>}</p>
<p>return content;</p>
<p>}</p>
<p>}</p>
<p>public static void SetPreference(Context context, string key , String value)</p>
<p>{</p>
<p>ISharedPreferences sp = PreferenceManager.GetDefaultSharedPreferences(context);</p>
<p>sp.Edit().PutString(key, value).Commit();</p>
<p>}</p>
<p>public static String GetPreference(Context context, string key)</p>
<p>{</p>
<p>ISharedPreferences sp = PreferenceManager.GetDefaultSharedPreferences(context);</p>
<p>return sp.GetString(key, null);</p>
<p>}</p>
]]></content:encoded>
					
					<wfw:commentRss>https://subodhnpushpak.wordpress.com/2015/03/12/xamarin-day-2-android-concepts/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/ca4dffc06c2219965b6c16d8705646c48cfbbec0bd22d82033a3b4cd4ed6f404?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">subodhnpushpak</media:title>
		</media:content>
	</item>
	</channel>
</rss>
