Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Saturday, March 5, 2011

Which are the file required or use for android application?


List of Files for an Android Application
The following list describes the structure and files of an Android application. Many of these files can be built for you (or stubbed out) by the android tool shipped in the tools/ menu of the SDK.


MyApp/

    AndroidManifest.xml
(required) Advertises the screens that this application provides, where they can be launched (from the main program menu or elsewhere), any content providers it implements and what kind of data they handle, where the implementation classes are, and other application-wide information. Syntax details for this file are described in The AndroidManifest.xml File.
    src/
        /myPackagePath/.../MyClass.java
(required) This folder holds all the source code files for your application, inside the appropriate package subfolders.
    res/
(required) This folder holds all the resources for your application. Resources are external data files or description files that are compiled into your code at build time. Files in different folders are compiled differently, so you must put the proper resource into the proper folder. (See Resources for details.)
        anim/
               animation1.xml
                        ...
(optional) Holds any animation XML description files that the application uses. The format of these files is described in Resources.
        drawable/
                      some_picture.png
                      some_stretchable.9.png
                      some_background.xml
                                    ...
(optional) Zero or more files that will be compiled to android.graphics.drawable resources. Files can be image files (png, gif, or other) or XML files describing other graphics such as bitmaps, stretchable bitmaps, or gradients. Supported bitmap file formats are PNG (preferred), JPG, and GIF (discouraged), as well as the custom 9-patch stretchable bitmap format. These formats are described in Resources.
        layout/
                      screen_1_layout.xml
                                 ...
(optional) Holds all the XML files describing screens or parts of screens. Although you could create a screen in Java, defining them in XML files is typically easier. A layout file is similar in concept to an HTML file that describes the screen layout and components. See User Interface for more information about designing screens, and Available Resource Types for the syntax of these files.
        values/
                      arrays
                      classes.xml
                      colors.xml
                      dimens.xml
                      strings.xml
                      styles.xml
                      values.xml
(optional) XML files describing additional resources such as strings, colors, and styles. The naming, quantity, and number of these files are not enforced--any XML file is compiled, but these are the standard names given to these files. However, the syntax of these files is prescribed by Android, and described in Resources.
        xml/
(optional) XML files that can be read at run time on the device.
        raw/
(optional) Any files to be copied directly to the device.

Php for android instllation


PhpForAndroid.apk requires ASE r26. However, r26 hasn't been released yet (latest is r25) so we provide an unofficial ASE build by now. Please, don't tell ASE folks about bugs related to this build. Contact us instead or build your own ASE from trunk to discard an already addressed issue. 


Don't have barcode reader? Click here.
Download our unofficial ASE build
ASE only comes with a shell interpreter by default.

Install PhpForAndroid.apk

Don't have barcode reader? Click here.Download latest release (Releases page)Once installed, run it and tap on “Install”.The PHP binary and the scripts will become available to ASE.Now!, run ASE. You should be able to see PHP demo scripts and they should work!.Doesn't it work? Please, try uninstalling and installing again (this is alpha software).Still not working? Fill this survey please: http://www.zoomerang.com/Survey/WEB22AXDHRY8L5



Getting started

ASE ApiReference is your friend : http://code.google.com/p/android-scripting/wiki/ApiReference

The real time ways (no more install, no SDK, nothing required)

1. Add/Edit PHP scripts on your mobile

ASE allows you to add or edit scripts on your mobile.

2. Use testnow.php

“allow_url_include” is On by default so you can include your code easily.
Include your own internet publicly available script. You'll find an already installed php script called “test.php”:
require_once("Android.php");
include("http://phpforandroid.net/files/testnow.php.txt"); // ".txt"
extention required to prevent parsing
 
And video tutorial for  PHPforAndroid.apk  HOW TO  install and test
  
http://vimeo.com/13177370
 

Monday, February 28, 2011

check if an object has been instantiated in php?

You have to check a variable to see whether it contains an object of the
right type

Thus
-------------------------------------------------------------
Dim X as clsContract

If X is nothing then
MessageBox.Show("There is No Object here")
Endif
X = New clsContract

If Not (X is nothing) then
MessageBox.Show("There is an Object here")
Endif
-------------------------------------------------------------


However the variable you test can be a shared variable within the class.
This is an example of the 'singleton' pattern.

Thus
-------------------------------------------------------------
Public Class clsContract
Private Sub New()
End Sub
Private Shared mSingleton as clsClass
Public Shared Function GetSingleton as clsContract
If mSingleton is nothing then
mSingleton = New clsContract
Endif
return mSingleton
End function
Public Shared function Exists() as boolean
return not (mSingleton is nothing)
End function
End Class
-------------------------------------------------------------

Your button code might then use this
-------------------------------------------------------------
Dim x as clsContract = clsContract.GetSingleton()
-------------------------------------------------------------

This may or may not be what you mean.

Wednesday, February 23, 2011

php crash when 2 clients at same time ?

Having an issue that is specific to PHP compiled with PGSQL support
with versions noted in subject line. I understand that there are many
variables to consider here but believe I have narrowed down the Apache
Client Cert failures to my PHP/PGSQL build.

1. Apache PHP without PGSQL works as expected using client certificates

2. Apache PHP with PGSQL works fine with standard SSL connections

3 Apache PHP with PGSQL fails with client certificates - no output

other than Segmentation faults in the apache error logs as follows:

[Wed Nov 30 23:26:57 2005] [notice] suEXEC mechanism enabled (wrapper:
/usr/sbin/suexec2)....

I also performed same tests on another instance of Apache/PHP/PGSQL
which was version 2.0.54 of apache and PHP/PGSQL versions same as
subject line with same exact results.

Any ideas as to the source of this problem and suggestions for
tests/fixes are greatly appreciated. There are no errors in any of the
logs other than what I have included so it's very difficult to see what
is wrong. All I know for sure is that I am able to reproduce the
results on more than one machine.

Wednesday, February 2, 2011

How to Android run on windows with first application ?


Step 1: First basic requirement of software installed in your pc .
  1. Java (JDK)
  2. Eclipse IDE
  3. Android SDK
  4. ADT (Android plug-in for Eclipse)
Step 2 : Java

If you already installed the any java version so please update the version .and JDK installer is straightforward and should not bring up anything interesting.

Step 3: Eclipse

Download the eclipse and install it .Eclipse is mostly used for java developers It is Eclipse IDE for Java Developers.

When the installation is complete for the Eclipse it is used with several java applications.

Step – 4 : Android SDK

Download the Android sdk and launch the SDK Setup

SDK Setup tool will immediately present you the list of all modules available for download. If it will get error so skip this step and follow:
Just cancel the step and go to the settings page and check that Force https://… checkbox like this

Check the root node (the one starting with https://…) and click the Install selected. Accept all the licenses and let the installer run for a while until it says everything is fine:

That’s it. You now have the Android SDK up and ready for work.

Step 5 : ADT

Time to install ADT  – Android Development Tools, a set of plugins for Eclipse that turn your IDE into a fully integrated Android development workbench. Point your browser at http://developer.android.com/sdk/eclipse-adt.html and find a section called Downloading the ADT plugin.

Now, looking  at a blank Eclipse installation that we will now turn into an Android-enabled IDE Go to Help and then Install New software and click on Add. Button.

After add Button and click ok then choose new Android item in the drop-down list next to the Work with : label

And click Next. Again, accept all licenses and wait until the installation is over. During the installation, you may be asked whether you accept unverified content. You can safely say yes, and trust all the certificates.

Installation is over and restart the Eclipse.

Installion is complete, But configure little ADT  so,

1 Go Window Menu.
2 Choose Preference .
3 Find the Android branch on the left.
4 Click on it and set the SDK Location property to the directory where you installed the SDK.

Step – 6 :  Creating a Basic App

Create a basic Android project

1.      Go to File menu.

2.      Choose New and the other

3.      Choose Android project.

After Click next button then fill the information of the project name, target platform for run the application and the official name of app. I chose to name the application bar, target it for Android 1.5  and chose to create an activity called Bar Activity

4 Click the finish button. After clicking Finish, Eclipse and ADT will generate a basic application according to the settings you chose.

5 Already launch the application but create an Emulater Instance first to launch this  app. Go to Window, then Android SDK and AVD Manager. This is a tool that allows you to manage your emulator instances. Switch to the Virtual Devices page and click New.

OK, the emulator’s ready! Now right-click on the root node of the project tree (the one that has an open folder icon and the name foobar next to it), choose Run As, Android Application.
The Android emulator is a good piece of software but it starts up quite slowly. It will show you a logo while it’s warming up: