www.nuneworld.net

September 23, 2014

how to access a localhost website from android device problem/solution

Filed under: Software — Tags: , , , , , , , , — admin @ 1:26 am

You may receive connection timeout or connection refused when you try to load your website from android or you are trying to access some service hosted on your local web server, so you can try this steps:

1. Check if in your manifest you have INTERNET permissions

2. Check if you accessing your website try the web site  http://YOUR_LOCAL_COMPUTER_IP_ADD/YOUR_SITE not http://localhost/yoursite because if you are using localhost you actually trying to access your phone loop-back interface

3. if you are using xamp  an you recieve this error   Access to the requested object is only available from the local network phpmyadmin then open your http.conf file vim /opt/lampp/etc/extra/httpd-xampp.conf and comment  ”Deny from all” or comment Require local depending of your version and Don’t forget to restart your XAMPP Server
4. if you are using Windows and still receiving error timeout or connection refused then your windows firewall is playing with you, for start you can turn your firewall to off,  also try to open your web site with mobile browser if your mobile browser cant access your site then there are big chances that your firewall is blocking your request to your web page, and you can try to fix like described here: http://www.mobitechie.com/android-2/how-to-access-localhost-on-android-over-wifi/ in my case firewall was the problem.

September 22, 2014

jQuery(function ($) does not work in update panel and repeater

Filed under: info — Tags: , , , — admin @ 1:38 pm

Jquery function:

$(function () {
$(”.sortableFull, .sortableEmpty”).sortable(
{
connectWith: “.sortableFull, .sortableEmpty”
});
$(”.sortableFull, .sortableEmpty”).disableSelection();});

After each update all scripts are removed, you have to bind them again, first place  your jquery function in javascript like function:

function init() {

$(function () {

$(”.sortableFull, .sortableEmpty”).sortable(

{

connectWith: “.sortableFull, .sortableEmpty”

});

$(”.sortableFull, .sortableEmpty”).disableSelection();

});

}

and make call with jquery in head :

jQuery(function () { init(); });
after that in your your update panel call each time like this:

<asp:UpdatePanel ID=”UpdatePanel1″ runat=”server”>

<ContentTemplate>

<script type=”text/javascript”>

Sys.Application.add_load(init);

</script>

….

or if you don’t use repeater you can register your script on page load on code behind like this:

ScriptManager.RegisterStartupScript(this, typeof(Page), Guid.NewGuid().ToString(), "init();", true);

September 19, 2014

Detect enter pressed ASP.Net on textbox

Filed under: info — Tags: , — admin @ 2:02 pm

In code behind add attributes to your text box like this:


txtSearch.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnTest.ClientID + "').click();return false;}} else {return true}; ");

September 3, 2014

UNABLE TO FIND CONNECTION…FOR OBJECT WEB.CONFIG

Filed under: info — Tags: , — admin @ 12:40 pm

Unable to find connection ‘your_conection_string’ for object  ’Web.config’. The connection string could not be found in application settings, or the data provider associated with the connection string could not be loaded.

Here’s what you need to do to start trouble-shooting the problem.

  • Close the dataset window with the error.
  • Right click the dataset in the solution explorer
  • Select “Open with…” from the context menu
  • Select “Source Code (Text) Editor” from the list and press the “OK” button

Your code will now be opened in text mode so you can view the XML. Near the top of the file, you’ll see a <connections> element with several <connection> elements within it.  Most datasets should only have one <connection> element.

If you have two <connection> elements when you remove one of them then also   change element DataSource DefaultConnectionIndex=”1″ to DataSource DefaultConnectionIndex=”0″

also in your web config your connection string should have providerName=”System.Data.SqlClient”

August 21, 2014

Disable a button control during postback in ASP.Net

Filed under: Software — admin @ 3:09 pm

Button disable technique for full .NET postbacks.

<asp:Button runat="server" ID="BtnSubmit"
  OnClientClick="this.disabled = true; this.value = 'Submitting...';"
  UseSubmitBehavior="false"
  OnClick="BtnSubmit_Click"
  Text="Submit Me!" />

July 1, 2014

Write binary file Windows phone 7

Filed under: info — Tags: , , , , — admin @ 8:34 am

using (MemoryStream stream = new MemoryStream())

{
stream.Seek(0, SeekOrigin.Begin);
String datum = “zzza-” + DateTime.Now.ToString(”ddMMyyyyhhmmss”) + “.txt”;
IsolatedStorageFile fileStorage = IsolatedStorageFile.GetUserStoreForApplication();
BinaryWriter Writer = new BinaryWriter(new IsolatedStorageFileStream(datum, FileMode.OpenOrCreate, fileStorage));                         Writer.Write(stream.ToArray());
Writer.Close();
}

June 12, 2014

File contains Microsoft.Xna.Framework.Media.Song but trying to load as Microsoft.Xna.Framework.Audio.SoundEffect

Filed under: Software — Tags: , , , — admin @ 11:39 pm

Click on your media (.mp3) file in Content folder and in properties file set content processor to sound effect.
Content importer: MP3 AUDIO FILE
Content processor: Sound effects
Right click your project, clean solution and now run your project …
be happy ;)

May 27, 2014

Conversion to Dalvik format failed with error 1

Filed under: Software — Tags: , , , — admin @ 1:08 pm

Conversion to Dalvik format failed with error 1 when exporting and signing apk in Eclipse:

Disable “Build Automatically” on “Project menu” and rebuild it manually (Right click on project -> Build project). Then try export the application again.

This should fix your problem

May 21, 2014

All major shortcuts for eclipse

Filed under: info — Tags: , — admin @ 11:07 pm
Use
Ctrl + SHIFT + L which will open a list of all major shortcuts for eclipse.
  • For single line java code comment : Ctrl + / (Forwards Slash) and
  • Single line uncomment : Ctrl + \ (Backslash)
  • For multiple line java code comment : Ctrl + Shift + / (Forwards Slash) and
  • Multiline uncomment : Ctrl + Shift + \ (Backslash)
  • For single line xhtml code comment/uncomment : Ctrl + Shift + c
  • For multiple line xhtml code comment : Ctrl + Shift + / (Forwards Slash)
  • For multiple uncomment : Ctrl + Shift + \ (Backward Slash)

May 14, 2014

C# a generic error occurred in GDI+ Solution

Filed under: Software — Tags: , , — admin @ 3:13 pm

check permissions to folder where your file is hosted. This problem is mostly occurred for the security reasons, you may not enough permission to write file and so on

May 12, 2014

Show line numbers in Eclipse java code

Filed under: Software — Tags: , , — admin @ 12:15 pm

Window Menu -> Preferences -> General -> Editors -> Text Editors -> check Show line numbers

Eclipse hangs at the Android SDK Content Loader

Filed under: info — Tags: , , — admin @ 9:56 am

when opening eclipse, your eclipse loading proces hangs at Android sdk content loader stuck at 0%, and loading is stoped than you should try this:

  1. Make sure that eclipse is not active. If it is active kill eclipse from the processes tab of the task manager
  2. Open %USERPROFILE%/(in Windows C:\users\YOURLOGINNAME\.android)
  3. Go to .android folder (This may be a hidden folder)
  4. Delete the folder “cache” which is located inside .android folder
  5. Delete the file ddms.cfg which is located inside .android folder
  6. Start eclipse
  7. Be happy :)

May 9, 2014

Corner radius Android get flipped

Filed under: Software — Tags: , , , — admin @ 12:12 pm

There is a bug in earlier versions of android, where they have incorrectly implemented ‘corners’ attribute of ‘Shape’ class. When specifying the corners separately, the bottom left and right corners get flipped.

So you can create separate folder for resource and place with identification of version or you can write a condition which checks the target version and accordingly you can set the correct background.

private void getPreICSButtonBackground() {
    if(Build.VERSION.SDK_INT >= 3.0){
        leftButton.setBackgroundDrawable(getResources().getDrawable(R.drawable.btn_rounded_left));
        rightButton.setBackgroundDrawable(getResources().getDrawable(R.drawable.btn_rounded_right));
    }
}

Where in ‘R.drawable.btn_rounded_left’ corners are implemented like

<corners android:topLeftRadius="5dp" android:topRightRadius="0dp"
    android:bottomLeftRadius="5dp" android:bottomRightRadius="0dp" />

and if it is running on earlier versions, then set the background having corners as


<corners android:topLeftRadius="5dp" android:topRightRadius="0dp"
    android:bottomLeftRadius="0dp" android:bottomRightRadius="5dp" />

April 14, 2014

Create and write file Windos phone

Filed under: Software — Tags: , , , — admin @ 11:05 am


String datum = "infoFile-" + DateTime.Now.ToString("ddMMyyyyhhmmss") + ".txt";
IsolatedStorageFile fileStorage = IsolatedStorageFile.GetUserStoreForApplication();
StreamWriter Writer = new StreamWriter(new IsolatedStorageFileStream(datum,FileMode.OpenOrCreate, fileStorage));
Writer.WriteLine(resultXml);
Writer.Close();

February 20, 2014

Invalid length for a Base-64 char array or string.

Filed under: Software — Tags: , , — admin @ 2:32 am

If you are using encryption for the string, you probably passing string to the url and when you are passing your string you dont use Server.UrlEncode. Use Server.UrlEncode(string) before redirecting and that will properly escape the + into a %urlchar .

Decoding the querystring values is done already when it’s parsed into the Request.QueryString collection so you dont need to use Server.UrlDecode(String)

Older Posts »

Powered by WordPress