Tuesday, June 25, 2013

Update Non market android application

Step 1: Create a Class: UpdateapplicationV


import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.util.Log;
public class UpdateapplicationV extends AsyncTask<String,Void,Void>{
private Context context;
public void setContext(Context contextf){
    context = contextf;
}

@Override
protected Void doInBackground(String... arg0) {
      try {
            URL url = new URL(arg0[0]);
            HttpURLConnection c = (HttpURLConnection) url.openConnection();
            c.setRequestMethod("GET");
            c.setDoOutput(true);
            c.connect();

            String PATH = "/mnt/sdcard/Download/";
            File file = new File(PATH);
            file.mkdirs();
            File outputFile = new File(file, "update.apk");
            if(outputFile.exists()){
                outputFile.delete();
            }
            FileOutputStream fos = new FileOutputStream(outputFile);

            InputStream is = c.getInputStream();

            byte[] buffer = new byte[1024];
            int len1 = 0;
            while ((len1 = is.read(buffer)) != -1) {
                fos.write(buffer, 0, len1);
            }
            fos.close();
            is.close();

            Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setDataAndType(Uri.fromFile(new File("/mnt/sdcard/Download/update.apk")), "application/vnd.android.package-archive");
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // without this flag android returned a intent error!
            context.startActivity(intent);


        } catch (Exception e) {
            Log.e("UpdateAPP", "Update error! " + e.getMessage());
        }
    return null;
}} 


Step 2: Add code in your main activity 

UpdateapplicationV atualizaApp = new UpdateapplicationV();
            atualizaApp.setContext(getApplicationContext());
            atualizaApp.execute("http://Your url/apkfile.apk");

Friday, June 21, 2013

Ref Link

R file does not generated:
 sudo apt-get install lib32z1

 sudo apt-get install lib32stdcc++6


Full stack chat xmpp Android Demo:
https://github.com/tech83/XMPP-Demo/tree/master/app/src/main/java/in/quantumtech/xmpp

Decompile APK file.
http://www.javadecompilers.com/apk


Bottom tabbar:
https://www.learn2crack.com/2017/06/android-using-bottomnavigationview.html



http://javapapers.com/web-service/java-web-service-using-eclipse/

http://javapapers.com/android/android-sqlite-database/

https://github.com/jgilfelt/android-sqlite-asset-helper

http://code.google.com/p/roottools/

http://code.google.com/p/android-roms/downloads/list/cyanogen_JFv1.51_CM3-ADP.zip

http://stackoverflow.com/questions/1101380/determine-if-running-on-a-rooted-device

chat application code:
https://github.com/Pirngruber/AndroidIM

https://code.google.com/p/simple-android-instant-messaging-application/



Android Billing Api

https://github.com/robotmedia/AndroidBillingLibrary

http://www.techotopia.com/index.php/Integrating_Google_Play_In-app_Billing_into_an_Android_Application_%E2%80%93_A_Tutorial


List View :
http://mrbool.com/how-to-use-json-to-parse-data-into-android-application/2894


http://www.androiddevelopersolution.com/2012/08/android-splash-screen-example.html
http://www.onlymobilepro.com/2013/01/16/android-beginner-creating-splash-screen/

 splash screen with background calling webservices.
http://www.androidhive.info/2013/07/how-to-implement-android-splash-screen-2/


cloud messages:
http://www.androiddevelopersolution.com/2012/12/android-goggle-cloud-messaging-gcm.html


Session Base Pref:
http://www.androidhive.info/2012/08/android-session-management-using-shared-preferences/

GCM
http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/


Splace screen:
http://www.androidhive.info/2013/07/how-to-implement-android-splash-screen-2/

Bar-Chart
http://rakhi577.wordpress.com/category/comparision-chart/

webservices
http://www.themobilemontage.com/2012/11/29/successfully-integrating-web-services-into-your-android-apps/

android-page-curl
https://github.com/MysticTreeGames/android-page-curl


Ui Base framework:
http://spb.com/android-software/uibuilder/

android game
http://www.kilobolt.com/day-6-the-android-game-framework-part-ii.html


Android Timer Blog:
http://android-er.blogspot.in/2013/12/example-of-using-timer-and-timertask-on.html



creating_a_splash_screen
http://docs.xamarin.com/guides/android/user_interface/creating_a_splash_screen/


Paypal in android
http://www.androiddevelopersolution.com/2012/09/paypal-integration-in-android.html

 Learn Java Collection :
http://mrbool.com/overview-of-java-arraylist-hashtable-hashmap-hashetlinkedlist/30383

android Icon Size:
http://iconhandbook.co.uk/reference/chart/android/


In App billing in android:
http://blog.blundell-apps.com/simple-inapp-billing-payment/

Icon maker:
http://makeappicon.com/download/74510a609680493a8cdbf6dc76fb724f#

Sync Adapter
http://udinic.wordpress.com/2013/07/24/write-your-own-android-sync-adapter/

Video Camera:
http://stackoverflow.com/questions/1817742/how-can-i-capture-a-video-recording-on-android

Data Sync:
http://chariotsolutions.com/blog/post/android-data-sync/


http://www.programcreek.com/java-api-examples/index.php?api=org.apache.http.entity.mime.HttpMultipartMode


http://www.youtube.com/watch?v=ZScE1aXS1Rs
http://android-er.blogspot.in/2011/04/simple-exercise-of-video-capture-using.html


popup:
http://androidresearch.wordpress.com/2012/05/06/how-to-create-popups-in-android/


encode file
http://stackoverflow.com/questions/6448865/base64-encode-audio-file-and-send-as-a-string-then-decode-the-string

Android image maker system
https://www.fluidui.com/editor/live/

Android service Link:
http://mrbool.com/android-services-how-to-create-your-own-services-in-android/30607

Video Record

http://sandyandroidtutorials.blogspot.in/2013/05/android-video-capture-tutorial.html
http://android-er.blogspot.in/2011/10/simple-exercise-of-video-capture-using.html

MVC Pattern To Create Very Basic Shopping Cart

http://androidexample.com/MVC/index.php?view=article_discription&aid=116&aaid=138#at_pco=smlre-1.0&at_si=53a0b57cf5d1c09a&at_ab=per-2&at_pos=1&at_tot=4


Pull to refresh
http://www.tutecentral.com/android-pull-to-refresh/
https://github.com/erikwt/PullToRefresh-ListView
http://www.incredibleandros.com/swiperefershlayout-android-example/


Download apk from store:
http://apps.evozi.com/apk-downloader/?id=com.xlabz.FindNearMe2



Share on facebook:
http://stackoverflow.com/questions/20015410/customize-android-intent-action-send?lq=1
https://github.com/antonkrasov/AndroidSocialNetworks



Animation CODE:
https://github.com/daimajia/AndroidViewAnimations
https://github.com/sd6352051/NiftyDialogEffects
https://github.com/pedrovgs/DraggablePanel


Animation Button
https://github.com/dmytrodanylyk/circular-progress-button

https://github.com/ManuelPeinado/FadingActionBar


Date & time picker:
https://github.com/zenyagami/DateTimepicker


Demo Project Link:
https://github.com/vlado-github/CropManager


https://github.com/coolguy101/ExampleXMPP

screen size:
http://screensiz.es/phone


http://www.androidhive.info/2014/12/android-uploading-camera-image-video-to-server-with-progress-bar/

https://github.com/survivingwithandroid/Surviving-with-android

arc seekbar

http://rakeshandroid.blogspot.in/2013/03/circular-seek-bar-example.html

http://stackoverflow.com/questions/13678262/android-circular-seekbar

https://github.com/devadvance/circularseekbar


Background camera:
http://stackoverflow.com/questions/21752637/how-to-capture-an-image-in-background-without-using-the-camera-application

For English:
https://www.ego4u.com/en/cram-up/grammar/tenses

For ilets:
http://www.examenglish.com/


Best English learning site:
http://www.englishleap.com


For java-design-patterns
https://github.com/iluwatar/java-design-patterns


Java Webservices rest api
http://www.javatpoint.com/android-web-service


flash light
http://www.javacodegeeks.com/2014/02/android-torch-app-with-stroboscopic-light-tutorial.html


Create a Music Player on Android: Song Playback:

http://code.tutsplus.com/tutorials/create-a-music-player-on-android-song-playback--mobile-22778


Class a wallpaper:
http://www.wallpaperup.com/search/results/tattoo/11


Greate Site to Learn to java , c++, c

http://www.sanfoundry.com


Best in class solution:
http://blog.nkdroidsolutions.com/arraylist-in-sharedpreferences/


DynamicCardLayout:
https://github.com/dodola/DynamicCardLayout
https://github.com/wujingchao/MultiCardMenu
https://github.com/MartinRGB/GiftCard-Android
https://github.com/elcrion/demo.cardlistview

https://github.com/qianlvable/VectorCard
https://github.com/xmuSistone/android-image-slide-panel

https://github.com/wangwang4git/CardView-SwipeDelete
https://github.com/DakotaCKIM/Carduino

https://github.com/arturh85/SyncDroid-SD

https://github.com/backupbrain/android-ripple-wallet
https://github.com/mycelium-com/wallet
https://github.com/schildbach/bitcoin-wallet
https://github.com/greenaddress/GreenBits

https://github.com/Clans/FloatingActionButton
https://github.com/shaobin0604/Android-HomeKey-Locker

All things.
https://github.com/motianhuo/android-open-project


http://www.talkenglish.com/lessonindex.aspx

https://github.com/oscarjiv91/Android-Check-Internet-Connection


ebook for self help
https://www.goodreads.com/user/rate_books?reg_path=true#self-help



http://www.talkenglish.com/extralessons/speakingrules.aspx

Material-design
http://www.raywenderlich.com/103367/material-design
http://www.android4devs.com/2014/12/how-to-make-material-design-navigation-drawer.html

facebook login:
http://blog.nkdroidsolutions.com/android-facebook-login-example-v4/


Fragment
http://www.raywenderlich.com/117838/introduction-to-android-fragments-tutorial 

Best  Animation Sorce:
https://github.com/Tim9Liu9/TimLiu-Android?files=1 
https://github.com/w446108264/XhsWelcomeAnim 
https://github.com/chenupt/SpringIndicator 


Video file
https://www.udemy.com/become-an-android-developer-from-scratch/ 
https://www.udemy.com/learn-android-development-from-scratch/ 

https://www.udemy.com/android-material-design-zero-to-hero/ 


Lib32(When R file doe not generate in ubuntu):
http://stackoverflow.com/questions/2757107/developing-for-android-in-eclipse-r-java-not-regenerating  

Phrases

https://www.speaklanguages.com/english/phrases/general-conversation 
https://www.speaklanguages.com/english/vocab/ 


 Demo code:
https://github.com/theappguruz 

 Root your phone
https://www.youtube.com/watch?v=XHrENHpb9tI 

 Help for app intro
 https://github.com/deano2390/MaterialShowcaseView
https://github.com/PaoloRotolo/AppIntro 




https://github.com/ribot/android-guidelines/blob/master/project_and_code_guidelines.md 
 Google auth login
https://www.learn2crack.com/2014/01/android-google-oauth2.html 

MarshMallow permision

https://www.learn2crack.com/2015/10/android-marshmallow-permissions.html 
https://android-arsenal.com/demo 

https://github.com/nicolasjafelle/PagingListView/tree/master/PagingListViewProject/PagingListView/src/main


https://android-arsenal.com/details/1/2797


http://angrytools.com/android/pixelcalc/

 UI Test
http://developer.android.com/tools/debugging/debugging-ui.html

 Youyube player for android
https://github.com/turekon/YouTubePlayerAndroidApp
https://github.com/pedrovgs/DraggablePanel
https://github.com/TheFinestArtist/YouTubePlayerActivity
https://github.com/youtube/yt-android-player


https://github.com/kaltura/player-sdk-native-android
https://github.com/ybq/Android-SpinKit
https://github.com/Yalantis/Side-Menu.Android
https://github.com/amulyakhare/TextDrawable



http://petrnohejl.github.io/Android-Cheatsheet-For-Graphic-Designers/


 Best Code factory
 https://github.com/Pixplicity

Best inapp purchased:
https://github.com/anjlab/android-inapp-billing-v3

https://classroom.udacity.com/me 

 Learn java
http://stackoverflow.com/search?q=user:22656+[java] 

https://github.com/tcking/GiraffePlayer 

https://github.com/danylovolokh/VideoPlayerManager 

https://github.com/ashqal/MD360Player4Android 

https://github.com/googleads/google-media-framework-android 


https://github.com/lipangit/jiecaovideoplayer/blob/develop/README_CUSTOM_UI.md 

https://github.com/FunPanda08/VLCPlayer_Android/tree/master/src/org/videolan 
https://github.com/daedrag/citi-pocket 


https://github.com/wasabeef/awesome-android-ui 

Camera code: 
https://github.com/fabian7593/MagicalCamera
https://github.com/Skykai521/StickerCamera 


https://github.com/guojunyi/PullDownListView/blob/master/PullDownListView/src/com/pulldownlistview/MainActivity.java


https://www.numetriclabz.com/android-linkedin-integration-login-tutorial/ 

https://github.com/Yalantis/CameraModule 
https://github.com/Yalantis/uCrop 

Getting contact from gmail
https://www.design19.org/blog/import-google-contacts-with-php-or-javascript-using-google-contacts-api-and-oauth-2-0/ 



***********************************************************
http://www.perfect-english-grammar.com/english-language-pdf.html
https://www.uop.edu.jo/download/research/members/Oxford_Guide_to_English_Grammar.pdf
----------------------------------------------------------------------------------------------------------------------
http://www.englishgrammar.org/common-idioms-english/
----------------------------------------------------------------------------------------------------------------------
http://www.grammar-teacher.com/englishgrammarsecrets.pdf
----------------------------------------------------------------------------------------------------------------------
https://www.easypacelearning.com/english-books/english-books-for-download-pdf/category/6-english-grammar-pdf-and-word-doc

***********************************************************
https://github.com/afollestad/easy-video-player

https://github.com/fbsamples/360-video-player-for-android

https://github.com/googlesamples/android-UniversalMusicPlayer 

************************************************************
Camera Class:Capture image and record video.
https://github.com/afollestad/material-camera


***********************************************************
Document Scanner with opencv.
https://github.com/ctodobom/OpenNoteScanner

***********************************************************
Epub reader
https://github.com/FolioReader/FolioReader-Android 



***********************************************************
Video Chat Code Sample:
https://github.com/xaccc/Communicator-for-Android
*********************************************************** 


 Arc View:
*********************************************************** 
https://android-arsenal.com/details/1/4694
*********************************************************** 

 

android-vertical-slide-view

*********************************************** 

https://android-arsenal.com/details/3/4653 

***********************************************************


https://android-arsenal.com/details/1/4530

***********************************************************
List Video play

https://android-arsenal.com/details/1/4548
***********************************************************
https://github.com/brucetoo/VideoControllerView
***********************************************************

***********************************************************
Background uploading Image or video with multi-part.

https://github.com/gotev/android-upload-service
***********************************************************

Ilets:
http://www.qposter.com/2015/05/Download-Cambridge-Practice-Tests-For-IELTS-1-10-With-PDF-File-Audio-CD-And-Answers.html



 
Android:  Boom Menu
https://android-arsenal.com/details/1/4912\




////////////////////////////////////////////////////////////////////////
http://therecipies.blogspot.in/2013/05/recipe-of-aloo-tikki.html 

 Get Distance From two location.

http://maps.googleapis.com/maps/api/directions/json?origin=Toronto&destination=Montreal&sensor=false 


https://github.com/nex3z/FlowLayout


 

Thursday, June 20, 2013

ScrollView set gravity on top , bottom in Android



public void onClick(View v) {
                    final Handler handler = new Handler();
                    new Thread(new Runnable() {
                        @Override
                        public void run() {
                            try {
                                Thread.sleep(100);
                            } catch (InterruptedException e) {
                            }
                            handler.post(new Runnable() {
                                @Override
                                public void run() {
                                    scrollView_On_Top.fullScroll(View.FOCUS_UP);
                                  //scrollView_On_Top.fullScroll(View.FOCUS_DOWN);
                                }
                            });
                        }
                    }).start();
                                  }

Sunday, June 2, 2013

Turn Wifi On/Off using WifiManager.setWifiEnabled() or WifiManager.setWifiDisabled()

Turn Wifi On/Off using WifiManager.setWifiEnabled() or WifiManager.setWifiDisabled()

Step 1:  ADD Or modify main.xml to add to button. in Layout.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   >
<TextView 
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:text="@string/hello"
   />
<TextView 
   android:id="@+id/wifistate"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   />
<Button
   android:id="@+id/onwifi"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:text="Turn Wifi On"
   />
<Button
   android:id="@+id/offwifi"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:text="Turn Wifi Off"
   />
</LinearLayout> 

Step 2: Add Or change code in your MainActivity Class.

package com.exercise.WifiStateChangedValkesh; 
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class WifiStateChangedValkesh extends Activity {
 
 TextView WifiState;
 
   /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.main);
       WifiState = (TextView)findViewById(R.id.wifistate);
       Button OnWifi = (Button)findViewById(R.id.onwifi);
       Button OffWifi = (Button)findViewById(R.id.offwifi);
      
       this.registerReceiver(this.WifiStateChangedReceiver,
               new IntentFilter(WifiManager.WIFI_STATE_CHANGED_ACTION));
      
       OnWifi.setOnClickListener(new Button.OnClickListener(){

   @Override
   public void onClick(View arg0) {
    // TODO Auto-generated method stub
    WifiManager wifiManager = (WifiManager)getBaseContext().getSystemService(Context.WIFI_SERVICE);
    wifiManager.setWifiEnabled(true);
   }});
      
       OffWifi.setOnClickListener(new Button.OnClickListener(){

   @Override
   public void onClick(View arg0) {
    // TODO Auto-generated method stub
    WifiManager wifiManager = (WifiManager)getBaseContext().getSystemService(Context.WIFI_SERVICE);
    wifiManager.setWifiEnabled(false);
   }});
   }
  
   private BroadcastReceiver WifiStateChangedReceiver
   = new BroadcastReceiver(){

  @Override
  public void onReceive(Context context, Intent intent) {
   // TODO Auto-generated method stub
   
   int extraWifiState = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE ,
     WifiManager.WIFI_STATE_UNKNOWN);
   
   switch(extraWifiState){
   case WifiManager.WIFI_STATE_DISABLED:
    WifiState.setText("WIFI STATE DISABLED");
    break;
   case WifiManager.WIFI_STATE_DISABLING:
    WifiState.setText("WIFI STATE DISABLING");
    break;
   case WifiManager.WIFI_STATE_ENABLED:
    WifiState.setText("WIFI STATE ENABLED");
    break;
   case WifiManager.WIFI_STATE_ENABLING:
    WifiState.setText("WIFI STATE ENABLING");
    break;
   case WifiManager.WIFI_STATE_UNKNOWN:
    WifiState.setText("WIFI STATE UNKNOWN");
    break;
   }
   
  }};
}
 

Step 3: Add permission "android.permission.CHANGE_WIFI_STATE" AndroidManifest.xml

 <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.exercise.WifiStateChangedValkesh"
     android:versionCode="1"
     android:versionName="1.0">
   <application android:icon="@drawable/icon" android:label="@string/app_name">
       <activity android:name=".WifiStateChangedValkesh"
                 android:label="@string/app_name">
           <intent-filter>
               <action android:name="android.intent.action.MAIN" />
               <category android:name="android.intent.category.LAUNCHER" />
           </intent-filter>
       </activity>

   </application>
   <uses-sdk android:minSdkVersion="4" />
   <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
</manifest>

Install Oracle Java 7 (JDK & JRE) in Ubuntu 13.04 , 12,10 and LinuxMin.

 Install Oracle Java 7 (JDK & JRE) in Ubuntu 13.04 , 12,10 and LinuxMin.
Step 1: Open  Terminal.

Step2:  Copy this command on terminal.

         sudo add-apt-repository ppa:webupd8team/java

Step3:  Copy this command on terminal.
        
          sudo apt-get update

Step4:  And Last, Copy this command on terminal.
        
          sudo apt-get install oracle-java7-installer
  

Saturday, June 1, 2013

How to enable fast scrolling in Android

Fast Scrolling in Android happens when you have a lot of items in your screen and you need to scroll fast. When it is activated you well see an small box coming from the right of the screen and when you drag it up or down it goes really fast. You can see this in your contact list, email or any application that has a lot of data and is sorted alphabetically.

There are 2 ways to enable this functionality in your application:
By adding the property in your XML layout file:



    <ListView
        android:id="@id/android:list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:fastScrollEnabled="true" />

or by adding it in your java code:

      getListView().setFastScrollEnabled(true);